!function(){"use strict";var e={937:function(e,t){function r(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function n(e,t,n){e(null,{verifier:t,challenge:r(String.fromCharCode.apply(null,new Uint8Array(n)))})}t.A=function(e,t){e||(e=43);for(var i=window.msCrypto||window.crypto,o=r(Array.prototype.map.call(i.getRandomValues(new Uint8Array(e)),(function(e){return String.fromCharCode(e)})).join("")).substring(0,e),a=new Uint8Array(o.length),c=0;c=s)throw new RangeError(`value must be >= 0 and <= ${s-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function f(e){var t=new Uint8Array(4);return p(t,e),t}function y(e){return l(f(e.length),e)}function h(){var e;return e=function*(e,t,r){for(var n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n),a=0;a>3)},h=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function c(e){a(o,n,i,c,u,"next",e)}function u(e){a(o,n,i,c,u,"throw",e)}c(void 0)}))},h.apply(this,arguments)}var d=function(e){return function(e){var t=e;"string"==typeof t&&(t=c.encode(t));for(var r=[],n=0;n>3))},T=function(e,t){var r=e.byteLength<<3;if(r!==t)throw new _(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function R(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}var j=function(){var e,t=(e=function*(){throw new k('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){R(o,n,i,a,c,"next",e)}function c(e){R(o,n,i,a,c,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),M=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function x(e){return new TypeError(`CryptoKey does not support this operation, its ${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"} must be ${e}`)}function D(e,t){return e.name===t}function B(e,t){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":if(!D(e.algorithm,"AES-GCM"))throw x("AES-GCM");var r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw x(r,"algorithm.length");break;case"A128KW":case"A192KW":case"A256KW":if(!D(e.algorithm,"AES-KW"))throw x("AES-KW");var n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw x(n,"algorithm.length");break;case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw x("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!D(e.algorithm,"PBKDF2"))throw x("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(!D(e.algorithm,"RSA-OAEP"))throw x("RSA-OAEP");var i=parseInt(t.slice(9),10)||1;if(o=e.algorithm.hash,parseInt(o.name.slice(4),10)!==i)throw x(`SHA-${i}`,"algorithm.hash");break;default:throw new TypeError("CryptoKey does not support this operation")}for(var o,a=arguments.length,c=new Array(a>2?a-2:0),u=2;u2){var n=t.pop();r+=`one of ${t.join(", ")}, or ${n}.`}else 2===t.length?r+=`one of ${t[0]} or ${t[1]}.`:r+=`${t[0]}.`;throw new TypeError(r)}}(e,c)}function $(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i2){var o=n.pop();e+=`one of type ${n.join(", ")}, or ${o}.`}else 2===n.length?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var I=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n2?r-2:0),i=2;i4&&void 0!==arguments[4]?arguments[4]:new Uint8Array(0),u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Uint8Array(0);return function*(){if(!t(r))throw new TypeError(I(r,...z));if(B(r,"ECDH"),!t(n))throw new TypeError(I(n,...z));B(n,"ECDH","deriveBits");var s,p=l(y(c.encode(i)),y(a),y(u),f(o));return s="X25519"===r.algorithm.name?256:"X448"===r.algorithm.name?448:Math.ceil(parseInt(r.algorithm.namedCurve.substr(-3),10)/8)<<3,function(e,t,r){return h.apply(this,arguments)}(new Uint8Array(yield e.subtle.deriveBits({name:r.algorithm.name,public:r},n,s)),o,p)}()})),L.apply(this,arguments)}function q(){return(q=N((function*(r){if(!t(r))throw new TypeError(I(r,...z));return e.subtle.generateKey(r.algorithm,!0,["deriveBits"])}))).apply(this,arguments)}function Y(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function Q(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Y(o,n,i,a,c,"next",e)}function c(e){Y(o,n,i,a,c,"throw",e)}a(void 0)}))}}function Z(e,t,r,n){return ee.apply(this,arguments)}function ee(){return(ee=Q((function*(r,n,i,o){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new _("PBES2 Salt Input must be 8 or more octets")}(r);var a=function(e,t){return l(c.encode(e),new Uint8Array([0]),t)}(n,r),u=parseInt(n.slice(13,16),10),s={hash:`SHA-${n.slice(8,11)}`,iterations:i,name:"PBKDF2",salt:a},p={length:u,name:"AES-KW"},f=yield function(r,n){if(r instanceof Uint8Array)return e.subtle.importKey("raw",r,"PBKDF2",!1,["deriveBits"]);if(t(r))return B(r,n,"deriveBits","deriveKey"),r;throw new TypeError(I(r,...z,"Uint8Array"))}(o,n);if(f.usages.includes("deriveBits"))return new Uint8Array(yield e.subtle.deriveBits(s,f,u));if(f.usages.includes("deriveKey"))return e.subtle.deriveKey(s,f,p,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}))).apply(this,arguments)}var te=function(){var e=Q((function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2048,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U(new Uint8Array(16));return function*(){var o=yield Z(i,e,n,t);return{encryptedKey:yield V(e.slice(-6),o,r),p2c:n,p2s:d(i)}}()}));return function(t,r,n){return e.apply(this,arguments)}}();function re(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new k(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function ne(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}var ie=function(){var r,n=(r=function*(r,n,i){if(!t(n))throw new TypeError(I(n,...z));if(B(n,r,"encrypt","wrapKey"),function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){var{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}(r,n),n.usages.includes("encrypt"))return new Uint8Array(yield e.subtle.encrypt(re(r),n,i));if(n.usages.includes("wrapKey")){var o=yield e.subtle.importKey("raw",i,...M);return new Uint8Array(yield e.subtle.wrapKey("raw",o,n,re(r)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){ne(o,n,i,a,c,"next",e)}function c(e){ne(o,n,i,a,c,"throw",e)}a(void 0)}))});return function(e,t,r){return n.apply(this,arguments)}}();function oe(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new k(`Unsupported JWE Algorithm: ${e}`)}}var ae=function(e){return U(new Uint8Array(oe(e)>>3))};function ce(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}var ue=function(){var t,r=(t=function*(t){var r,n;if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');var{algorithm:i,keyUsages:o}=function(e){var t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new k(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new k('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(t),a=[i,null!==(r=t.ext)&&void 0!==r&&r,null!==(n=t.key_ops)&&void 0!==n?n:o];if("PBKDF2"===i.name)return e.subtle.importKey("raw",v(t.k),...a);var c={...t};return delete c.alg,delete c.use,e.subtle.importKey("jwk",c,...a)},function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(e){ce(o,n,i,a,c,"next",e)}function c(e){ce(o,n,i,a,c,"throw",e)}a(void 0)}))});return function(e){return r.apply(this,arguments)}}(),se=ue;function le(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function pe(){return(e=function*(e,t,r){var n;if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;for(var r=e;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?se({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):v(e.k);case"RSA":if(void 0!==e.oth)throw new k('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return se({...e,alg:t});default:throw new k('Unsupported "kty" (Key Type) Parameter value')}},pe=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){le(o,n,i,a,c,"next",e)}function c(e){le(o,n,i,a,c,"throw",e)}a(void 0)}))}).apply(this,arguments);var e}function fe(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function ye(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){fe(o,n,i,a,c,"next",e)}function c(e){fe(o,n,i,a,c,"throw",e)}a(void 0)}))}}function he(){return(he=ye((function*(t,r,n,i,o){if(!(n instanceof Uint8Array))throw new TypeError(I(n,"Uint8Array"));var a,c,u,f,y=parseInt(t.slice(1,4),10),h=yield e.subtle.importKey("raw",n.subarray(y>>3),"AES-CBC",!1,["encrypt"]),d=yield e.subtle.importKey("raw",n.subarray(0,y>>3),{hash:"SHA-"+(y<<1),name:"HMAC"},!1,["sign"]),v=new Uint8Array(yield e.subtle.encrypt({iv:i,name:"AES-CBC"},h,r)),w=l(o,i,v,(a=o.length<<3,c=Math.floor(a/s),u=a%s,p(f=new Uint8Array(8),c,0),p(f,u,4),f));return{ciphertext:v,tag:new Uint8Array((yield e.subtle.sign("HMAC",d,w)).slice(0,y>>3))}}))).apply(this,arguments)}function de(){return(de=ye((function*(t,r,n,i,o){var a;n instanceof Uint8Array?a=yield e.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(B(n,t,"encrypt"),a=n);var c=new Uint8Array(yield e.subtle.encrypt({additionalData:o,iv:i,name:"AES-GCM",tagLength:128},a,r)),u=c.slice(-16);return{ciphertext:c.slice(0,-16),tag:u}}))).apply(this,arguments)}var ve=function(){var e=ye((function*(e,r,n,i,o){if(!(t(n)||n instanceof Uint8Array))throw new TypeError(I(n,...z,"Uint8Array"));switch(function(e,t){if(t.length<<3!==W(e))throw new _("Invalid Initialization Vector length")}(e,i),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&T(n,parseInt(e.slice(-3),10)),function(e,t,r,n,i){return he.apply(this,arguments)}(e,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&T(n,parseInt(e.slice(1,4),10)),function(e,t,r,n,i){return de.apply(this,arguments)}(e,r,n,i,o);default:throw new k("Unsupported JWE Content Encryption Algorithm")}}));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),we=ve;function me(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function ge(){return(e=function*(e,t,r,n){var i=e.slice(0,7);n||(n=O(i));var{ciphertext:o,tag:a}=yield we(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:d(n),tag:d(a)}},ge=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){me(o,n,i,a,c,"next",e)}function c(e){me(o,n,i,a,c,"throw",e)}a(void 0)}))}).apply(this,arguments);var e}function Ae(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}var Ee=function(){var r,n=(r=function*(r){if(r instanceof Uint8Array)return{kty:"oct",k:d(r)};if(!t(r))throw new TypeError(I(r,...z,"Uint8Array"));if(!r.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");var{ext:n,key_ops:i,alg:o,use:a,...c}=yield e.subtle.exportKey("jwk",r);return c},function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Ae(o,n,i,a,c,"next",e)}function c(e){Ae(o,n,i,a,c,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}(),be=Ee;function Se(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function Pe(){return(e=function*(e){return be(e)},Pe=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Se(o,n,i,a,c,"next",e)}function c(e){Se(o,n,i,a,c,"throw",e)}a(void 0)}))}).apply(this,arguments);var e}function Ce(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function Ke(){var e;return e=function(e,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return function*(){var a,c,u;switch(function(e,t,r){e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?function(e,t){if(!(t instanceof Uint8Array)){if(!J(t))throw new TypeError(G(e,t,...z,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${z.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}}(e,t):function(e,t,r){if(!J(t))throw new TypeError(G(e,t,...z));if("secret"===t.type)throw new TypeError(`${z.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${z.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${z.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${z.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${z.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)}(e,t,r)}(e,n,"encrypt"),e){case"dir":u=n;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":if(!function(e){if(!t(e))throw new TypeError(I(e,...z));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}(n))throw new k("ECDH with the provided key is not allowed or not supported by your javascript runtime");var{apu:s,apv:l}=o,{epk:p}=o;p||(p=(yield function(e){return q.apply(this,arguments)}(n)).privateKey);var{x:f,y:y,crv:h,kty:v}=yield function(e){return Pe.apply(this,arguments)}(p),w=yield function(e,t,r,n){return L.apply(this,arguments)}(n,p,"ECDH-ES"===e?r:e,"ECDH-ES"===e?oe(r):parseInt(e.slice(-5,-2),10),s,l);if(c={epk:{x:f,crv:h,kty:v}},"EC"===v&&(c.epk.y=y),s&&(c.apu=d(s)),l&&(c.apv=d(l)),"ECDH-ES"===e){u=w;break}u=i||ae(r);var m=e.slice(-6);a=yield V(m,w,u);break;case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":u=i||ae(r),a=yield ie(e,n,u);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":u=i||ae(r);var{p2c:g,p2s:A}=o;({encryptedKey:a,...c}=yield te(e,n,u,g,A));break;case"A128KW":case"A192KW":case"A256KW":u=i||ae(r),a=yield V(e,n,u);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":u=i||ae(r);var{iv:E}=o;({encryptedKey:a,...c}=yield function(e,t,r,n){return ge.apply(this,arguments)}(e,n,u,E));break;default:throw new k('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:u,encryptedKey:a,parameters:c}}()},Ke=function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Ce(o,n,i,a,c,"next",e)}function c(e){Ce(o,n,i,a,c,"throw",e)}a(void 0)}))},Ke.apply(this,arguments)}function He(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function ke(e,t){for(var r=0;r(new Date).getMilliseconds();if(d.inSample){window.lpTaglogListeners.push(function(e,t,i){if(t&&o[t]<=d.level&&p&&-1===a.indexOf(s,i)){t={accountId:lpTag.site,appVersion:lpTag.taglets.lpUnifiedWindow.v,context:"webMessaging",immediate:!0,logLevel:t,msg:t+" : "+i+" : "+e,time:(new Date).toISOString(),trace:!1,url:window.location.href};u.push(t)}});g()}}},error:h,info:function(e,t){i(e,"INFO",t||n)},debug:function(e,t){i(e,"DEBUG",t||n)},setLogLevel:f,logLevels:o,events:t,triggerEvent:function(e){switch(e){case t.APP_STARTED:p=!0;break;case t.APP_ENDED:p=!1}},loggosLogging:d,loggosLogQueue:u}}();window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.apps={AUTHENTICATION:"authenticationDelegate",STEP_UP:"stepUpManager",CHAT:"API",CHAT_STATE:"ChatStateManager",APPLICATION:"EmbeddedWindowApplication",HEARTBEAT:"HeartBeatManager",UISTATE:"UIStateManager",UNIFIED_WINDOW:"lpUnifiedWindow",SECURE_FORM:"leSecureForm",WINDOW_SDK:"windowSDK",COBROWSE:"cobrowse",RICH_CONTENT:"richContent",FILE_SHARE:"fileShare",QUICK_REPLIES:"quickReplies",MAVEN_PAY:"mavenPay",DATE_PICKER:"datePicker",SCHEDULE_LIST:"scheduleList"};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.events={chat:{ERROR:"error",INITIALIZED:"initialized",BLOD:"blueLightOfDeath(Ended)",CHATTING:"chatting",STATE:"state",CONVERSATION_STATE:"conversationState",DIALOG_STATE:"dialogState",CONVERSATION_CLOSED:"conversationClosed",CHAT_INFO:"chatInfo",USER_INFO:"userInfo",USER_LEFT:"userLeft",ENGAGEMENT_DATA:"engagementData",LINE:"line",COLLABORATION:"collaboration",SECURE_FORM:"leSecureForm",FINISHED_EVENTS_BULK:"finishEventsBulk",AGENT_TYPING:"agentIsTyping",AVAILABILITY:"availability",SURVEY_ERROR:"surveyError",SURVEY_SERVER_ERROR:"surveyServerError",EMAIL_TRANSCRIPT_SUCCESS:"emailTranscriptSuccess",EMAIL_TRANSCRIPT_ERROR:"emailTranscriptError",AUTHENTICATION_ERROR:"authenticationError",START_CHAT_INFO:"startChatInfo",TTR_INFO:"ttrInfo",CSAT_INFO:"csatInfo",BRAND_INFO:"brandInfoReceived",CONVERSATION_OWNER_BRAND_INFO:"conversationOwnerBrandInfoReceived",CONVERSATION_CONTENT:"conversationContent",SUBSCRIBE_MESSAGING_EVENTS_RESPONSE:"subscribeMessagingEventsResponse",CONVERSATION_HISTORY:"conversationHistory",NEW_CONVERSATION_REQUESTED:"newConversationRequested",NEW_CONVERSATION_CREATED:"newConversationCreated",MULTIPLE_CHANNELS_REQUESTED:"multipleChannelsRequested",SESSION_DATA:"sessionData",NO_SESSION:"noSession",FAILED_START_CONVERSATION:"failedStartConversation",FORGET_ME:"forgetMe",SET_REFRESH_MODEL_DELAY:"setRefreshModelDelaySec",CLOSE_WINDOW_FORGET_ME:"closeWindowForgetMe",DELETE_CONVERSATION_SUBSCRIPTION:"onDeletedSubscriptionFromConversation",CONVERSATION_STEP_UP:"onConversationStepUp",SIGNAL_OUT:"SIGNAL_OUT",SIGNAL_IN:"SIGNAL_IN"},socket:{CONNECTED:"socketConnected",INITIALIZED:"socketInitialized",DISCONNECTED:"socketDisconnected",NON_RESPONSIVE:"socketNonResponsive",PING_SUCCESS:"pingSuccess"},application:{PROCESSING:"processing",OFFLINE_SURVEY:"offlineSurvey",PRE_CHAT_SURVEY:"preChatSurvey",POST_CHAT_SURVEY:"postChatSurvey",PRE_SMS_FORM:"preSmsForm",PRE_SMS_FORM_EXIT:"preSmsFormExit",END_CHAT:"endChat",END_SURVEY:"endSurvey",ENDED:"appEnded",DO_HARAKIRI:"doHaraKiri(Seppuku)"},heartBeat:{INIT:"init",FAILED:"failed",RESUMED:"resumed"},uiState:{POP_OUT:"popOut",EMBEDDED_CHANGED:"embeddedChanged",MAXIMIZED:"maximized",MINIMIZED:"minimized",ACTIONS_TOGGLE:"actionsToggle",SEND_BUTTON:"sendButton",INPUT:"input",PAPER_PLANE_BUTTON:"paperPlaneButton",FOCUS_CHANGE_EVENT:"focusChanged",EMOJI_FOCUS_ON_CLICK:"emojiFocus"},chatState:{ENDED:"ended"},unifiedWindow:{MAXIMIZE:"maximize"},viewController:{INITIATE_END_CHAT:"endChatInitiate",CLICKED:"clicked",DIALOG:"dialog",DIALOG_CLOSED:"dialogClosed",DIALOG_STATE_CHANGED:"dialogStateChanged",SLIDER_CLOSED:"sliderClosed",PREPARE_SLIDER_CLOSED_TIMEOUT:"prepareSliderCloseTimeout",SLIDER_VIEW_CHANGE:"sliderViewChange",CLOSE_ACTIONS:"closeActions",VISITOR_HAS_TYPED:"visitorHasTyped",MAXIMIZE_VISIBLE:"maximizeVisible",MINIMIZE_VISIBLE:"minimizeVisible",LINE_ADDED:"lineAdded",LINES_VIEWED:"linesViewed",CONVERSATIONS_VIEWED:"conversationsViewed",RETRY_GET_HISTORY:"retryGetHistory",END_OF_HISTORY:"endOfHistory",CB_OFFER:"cbOffer",THANK_YOU_PAGE:"thankYouPage",SHOW_FORGET_ME:"forgetMeDialog",CLOSE_WINDOW_FORGET_ME:"closeWindowForgetMe",LINE_UPDATE:"lineUpdate",UPDATE_TIME_STAMP:"updateTimeStamp",UPDATE_ACCESSIBILITY_MESSAGE:"updateAccessibilityMessage",SCROLL_CONVERSATION_TO_BOTTOM:"scrollConversationToBottom",FLUTTER_OPEN:"flutterOpen",FLUTTER_CLOSE:"flutterClose",FLUTTER_IS_CLOSED:"flutterIsClosed",FLUTTER_STYLE_UPDATE:"flutterStyleUpdate",DATE_PICKER_SHOW:"DatePickerShow",ADD_PRODUCT_DETAILS:"addProductDetails",SCHEDULE_LIST_SHOW:"ScheduleListShow",HISTORY_TRY_NEXT:"historyTryNext"},coBrowseEvents:{OFFERED:"cobrowseOffered",ACCEPTED:"cobrowseAccepted",DECLINE:"cobrowseDeclined",TIMEOUT:"cobrowseTimeout",INVITED:"cobrowseInvited",STARTED:"sessionStarted",RESUME:"sessionResume",ERROR:"sessionError",CANCELED:"cobrowseCanceled",DIALOG_CREATED:"cobrowseDialogCreated",RENDER_CALL_SCREEN:"cobrowseRenderCallScreen",SLIDER_OPENED:"sliderOpened",MAXIMIZE:"maximize"},widgetSDK:{INIT:"init",PARTICIPANTS:"participants",MESSAGES:"messages",WIDGET_AREA_STATE:"widgetAreaState",CONVERSATION_STATE:"conversationState",CONVERSATION_INFO:"conversationInfo",ENGAGEMENT_INFO:"engagementInfo",NOTIFICATION:"notification",VISITOR_TYPING:"visitorTyping",AGENT_TYPING:"agentTyping",DISPOSED_WIDGET_ID:"disposedWidgetID",INITIATED_WIDGET_ID:"initiatedWidgetID",WIDGET_NOTIFICATION:"widgetNotification"},imageShare:{IMAGE_SELECTED:"imageSelected",FILE_UPLOAD_URL_READY:"fileUrlGenerated",FILE_DONE_UPLOADED:"fileUploaded",FILE_UPLOAD_RETRY:"fileUploadRetry",FILE_DOWNLOAD_REQUEST:"fileDownloadRequest",SHOW_PREVIEW:"showPreview",OVERLAY_CLOSED:"overlayClosed",IMAGE_PREVIEW_CLOSED:"ImagePreviewClosed",IMAGE_PREVIEW_SHOW:"ImagePreviewShow",FILE_VALIDATION:"fileValidation"},richContent:{DISABLE_RICH_CONTENT:"disableRichContent",UPDATE_RICH_CONTENT_LINE:"updateRCLine"},wrapperWindowExtender:{WINDOW_SCALE_SET:"windowScaleSet"},accessibility:{SET_INPUT_FOCUS:"setInputFocus"}};lpTag.unifiedWindow.publicEvents=lpTag.unifiedWindow.publicEvents||{API:{state:[{appName:"lpUnifiedWindow",eventName:"state",data:{state:"data"}},{appName:"ChatAPIV3",eventName:"state",data:"data"}],chatInfo:{appName:"lpUnifiedWindow",eventName:"conversationInfo",data:{agentName:"data.agentName",agentId:"data.agentId",conversationId:"data.rtSessionId",state:"data.chatState",monitoringSessionId:"data.monitoringSessionId",visitorId:"data.visitorId",skill:"data.skill",skillName:"data.skillName",engagementId:"data.engagementId",campaignId:"data.campaignId",language:"data.language",engagementName:"data.engagementName"}}}};lpTag.unifiedWindow.SurveyType={PRE_CHAT:"PreChatSurvey",EXIT_CHAT:"ExitSurvey",OFFLINE:"OfflineSurvey",CSAT:"CSAT",PRE_SMS:"PreSmsSurvey"};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.consts={dialog:{actions:{CONFIRM:"confirm",CANCEL:"cancel"}},views:{TOP_MENU:"topMenu",ACTION_MENU:"actionMenu"},chatEvents:{LINE:"line",INFO:"info",COBROWSE:"cobrowse",SECURE_FORM:"leSecureForm",RICH_CONTENT:"richContent",FILE_SHARING:"hosted/file",MAVEN_PAY:"mavenPay"},errorTypes:{CONNECTION_UNAVAILABLE:"CONNECTION_UNAVAILABLE",AUTH_ERROR:"AUTH_ERROR",FAILED_START_CONVERSATION_ERROR:"FAILED_START_CONVERSATION_ERROR"},authErrorsTypes:{EXPIRED:"expired",INVALID_SESSION:"invalidSession",LOGOUT:"logout"},SecureForm:{LINK_CLICKED:"secureFormClicked",HIDE_CONVO:"hideMessagingConversation"},RichContent:{ACTION:"richContentAction",RICH_CONTENT_LINE:"rich-content",RICH_CONTENT_TYPE:"richcontent",LINK_CLICKED:"richContentLinkClicked"},engagementContainerClass:"LPMcontainer",reCaptchaContainerClass:"reCaptchaContainer",authConnectorTypes:{S2S:0,OAUTH_IMPLICIT:1,OAUTH_CODE:2,STEP_UP:3},defaultRedirectUri:"https://liveperson.net",slider:{viewType:{widgetSDKView:"widgetSDKView",PCIFormView:"pciFormView",CoBrowseInvite:"cobrowseInviteView",CoBrowseCallConnecting:"cobrowseCallConnectingView",RichContentLinkAction:"richContentLinkAction",MavenPayLinkView:"MavenPayLinkView"}},widgetSDK:{WIDGET_NAME:"widgetName",AGENT:"agent",AGENT_ID:"agentId",VISITOR:"visitor",VISITOR_ID:"visitorId",SESSION_ID:"sessionId",MONTORING_SESSION_ID:"monitoringSessionId",ACCOUNT_ID:"accountId",CHANNEL_TYPE_MESSAGING:"messaging",CHANNEL_TYPE_CHAT:"chat",contentType:{text:"text/message",richContent:"text/richContent"}},csatStatus:{FILLED:"FILLED",PARTIALLY_FILLED:"PARTIALLY_FILLED",SKIPPED:"SKIPPED",EMPTY:"EMPTY"},coBrowse:{acceptedCoBrowseModes:["view","shared","follow","VIDEO_CALL","VOICE_CALL"],coBrowseChannelName:"COBROWSE"},engagementTypes:{CHAT_ENGAGEMENT:"chat",MESSAGING_ENGAGEMENT:"messaging"},richContentActionTypes:{LINK:"link",NAVIGATE:"navigate",PUBLISH_TEXT:"publishText",CAROUSEL_OFFSET_CHANGE:"carouselOffsetChange",CHECKED:"checked",SUBMIT_AS_TEXT:"submitAsText",DATE_PICKER:"datePicker",SCHEDULE_SLOT_LIST:"scheduleSlotList",ADD_TO_CART:"addToCart"},fileSharing:{fileAttributes:{TYPE:"type",SIZE:"size"},fallbackThumbnail:{URI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABaCAYAAAAFOiBkAAAAAXNSR0IArs4c6QAACf9JREFUeAHtXelzFMcVf7u6FnQAlkDoQAe7qwuBHISQQSIFCGRIikDssp2kqLjs2FWO+ZB/If9CPqeKipNUOR9CiEOEAVsWBowBGxuD0YEudEvoAq/uA/J+rZ3JaLSjnVnNrIw0jxptT0/P6+5fv37d/fpN4yAVNTU1Fc7MzLzL0ceePXuWwpdLlWRF3Docjgm+ergy5yIjI//s8Xi+V1bMId0wAFENDQ1/4vu3ExMTI+Pj4yOio6OJX5aSrKhfri9NTU2Rz+ebHRwcnOHKnc7Nzf0D13caFRW19oNS7XK5StLS0lyM4IoCIVhluIdQV1fXBNNXDE4FwHHiJUgKQMnMzFx1oKD+EATUHRj4ew05/Drla7fbHbPaJAWgKAmS09zcPMk47HJC0UKnrHZQABAwABbABF3pGBStErnVHPZjcczJijcFo49NcwgAC2ACYFwrdUgOpbGBBTARo1IoDFb6OzYwGi1sA2MDo4GARrQtMTYwGghoRNsSowGMZcvop0+f0hfXv6Ta2loaGRnVyD706Li4WCooKKCyvXvI6TS/fS0DBqDcuvVV6DUP8ibAlvjvKy8Lktr4Y/Oh9pcBkhIOsiofy4CxovsEAtqqfCzrSoEqoY7LyMigA/t/KqJrLl+h9vZ2dZJlu7dMYvTUCKDExcWJSwJIz3vhSLOswISjgqHmsazAoPuMjIyIC+EfEy2rjoFO+eCvf/8x4SGXZVmBkUsRIBAREUGvvnJC7Gv988xZmp2dDZDKuqhl6UpZWZm0YcOGRWu1c+dPaOPGjZSUlEQIh5vCDozX66Gf/+wovf7aq7R169aA9U1IiKdiBRgIIy6cFFZg0D32vFQq6oetiqNHKqm4eOeC+u7bV05IKxHCiAsnhRWYF4t2EG9PzKvfS6W7qeLgAXkhmJWZSbjUpBWvTmfWfdiAWbNmjaauyMvLpePHj1FsbOyikqGWJLNACMQnbMCU7i6hxfavUlNS6Ne/emNRXaLWPYEqZFZcWIBBhQoK8oOWOSYm+MYfRiiXKyYor6UmCAsws7NPaWxsbKllFe+PjY+bwicYE8smeLCwSSaB0dFR+ssHfwtWlpCeIx8ryDKJgdkxHGRVPpZJDGyxoHDYfK1oAMuAgYEatlgr7LFWAKHmaVlXUmf0vN3bwGi0mA2MDYwGAhrRtsTYwGggoBFtS4wNjAYCGtG2xNjAaCCgEW1LjAYwpq+VsLPY3d1DcBzasiVdmCuRd29vH01MTgS058Is0ffoEW1OTqa1a9fKRTXCq7X1ofgWAHmaQaYCc+fOd3T58yvzNscqKg4SjODXv7xBPT09dOr99xaUu6Ozk6qqPqZfnjjOWyrZ4rkRXjfZQenatS+o8vAh0RgLMgghwjRgWlpaqfqzGsrI2EIAIyY6hh62PSSvx2O4WEZ4QRKvs/dWbk4Obd9eaDgvrRdMA+YqtxjoyMuV8hbJthCNVXp5TU9PU9X5j4UbyeHDFVp1DCneFOU7MzNL/F2h2E5V7xsZLZURXpDQx48fU2XlIYqJMddAbgow4+Nj+GKDkpM3GcVhQXq9vCYnJ+n+/Tk/v+am5gV8lhphCjDwioLFrrOza6nlEd1CDy80BHQKlPWd7+7iY88l561kYAow+MYnmYfaJ0+eiC4lZYDCQw8YIb28oqKi6OCB/XToUAUhfPHSp4RuaBZFnDp16o9wt1gqJSQkUG1dHTXz6ORg6RkYGKDPr1ylwYFBys7Oorr6BqEPIA1d3d3ylZSUKOIbG5soPy9PuIfo4YW5D/a9Y/iLNGzA1dbWiWlCoH1vo3VD2U0blTIzM+jE8V/QZzWXqYYvEBRxEc9hJMJXqlevXpNuxW9ujnfePW708FK+VLRjB9Uz8Ldvf8PDtpc2b96sfBxS2MHbG8/y84Nvnxrhzh92c3KHKVupZvLSW4c6lnzTJEaZKX/YrbxdUthMXkYKYoryNZLh85LWBkajpWxgNIDRpWM6OjppeibwfCQ6KprS09MEe5gaunkoHhwcYgegBEpNTdGcqrexj6+D/2HRqSQM5VOTU2KIb2ltpXiePGI64WNzRn9/vzKpCK9ft46POhkRJoe0tFT5OcwYL7BnKOY4ILih9Pb10Ub2AtWzbNEFzMVLn4jJm5yrIgB30zd/e5Iwr/j3R+fY7tIrP4XrGDw0A9lI7t69Rw8eNNK777wtQMRLOM/lzJl/UQp7V8Hl9ezZj4TD0dEjL1N7WztduHhJ5i0FdhUX09DwEHV0dND7v39PAIRn/+Gy7C3bQ9JC9ls2idy4cZNOnvyNecDA9XSWpQH04Yf/4EnYC3SEPS5BkX7vygsXLtHQ0JCwqUAK+rh1qs5foP9Wnad3fveW3HLiJf6DAgOYhoYHVFKyS0Rjkjc9PUPbC7XNB8g3NfX/kuHixWNzSwvBVPGwrY08brew+/zg8wneEjB8yodogORN+tZzunQMusWG9evF5XA4KYpdUaV7iGVf3yNRKLd7q1i7wFWVD+ihMm4xiHA9V15NkAhY65TPMHPG8Oz1etTJ5fv4uHg5b5QBTo8AAzPqJv9iEmCD2ljKMA/CUqW/f4BtQ26ZT7CArq4UjEn/wFzfT0+fb1ZElwA9Hh5ewAIVyWdvzdvffEvD/DySdQF0GWbK8OvFOisQwVYDMEClu3eJBgCYWzhvSA303IPGRtEdYTFsZLCmpiZF+sUAFwkUf3RJjCJ9wODkxFzGUJRKkhTf1FRgxS15Q0Fq6urqBRiFhduULBaEcWSWdPlPkhJpvDkeGmf/PHwnCWVcWloilDafICQkCdIJKdZLpkiMpOWh9bOzs+S8fT/4RHjdugQ5ThnYtAnfCiQKXYB43AfTAeVlZQtGMrzrcXuourqGbty8JUZCLCaxgMVHq5C+7UEABw8lmSIxMDnAXKC2iXx//77Ia7GWgnKE9Q9X4bbFpUVZcHU4NnatmB7gKxXoOnRHPohLdC0AY6QbgbcpEgOJyONC1NXX0yefVlM6iyzmKbCwQTGmpGivdvPz8+gKr7hRET2L2XruGpBMiTCHgvM0KMfr5cbpphz/ih3lQt5DQ8MsZRnSK7p+TQEGOVVWHiZnhFPYRTBHgRf4i0VFtN//MahWaTDXgdjDZqvHsfnevXnn+FF5+V4ZGEgFtmmUNpnc3Bzq630kf6ugVQ51vOlmB4jt6OgYmyhj1Xlp3sN+i664mEu95suqB5geKDft0LVwGeFtidkBFTQCCuplpoVfCQp4o4viMkqmKF+jmT4P6W1gNFrJBsYGRgMBjWhbYmxgNBDQiHby8DqBuYdNcwgAC2ACYHpgObNpDgFgAUygY875+HhoG5g5BPxYnHNG8kHiODMb26ernYABsAAmTv/p6qdxZvZqB8aPwWlgYh+mztIASQEoTPJh6gIYSAprY/v4ffXx+8ouZP+HDXNo/A/VKuq403VhBwAAAABJRU5ErkJggg==",TYPE:"image/png",HEIGHT:90,WIDTH:70}},googleMapsUrl:"https://www.google.com/maps/search/?api=1&",externalTargets:{SMS:0},MavenPay:{LINK_CLICKED:"mavenPayClicked"},stepUpInWaitingState:{appName:"stepUpInWaitingState",storageKey:"-stepUpDataInWaitingState"},messageTypes:{secureForm:"leSecureForm"},fifteenMinutesInMS:9e5};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.hooks={BEFORE_SUBMIT_SURVEY:"BEFORE_SUBMIT_SURVEY",BEFORE_WELCOME_MESSAGE:"BEFORE_WELCOME_MESSAGE",AFTER_GET_SURVEY:"AFTER_GET_SURVEY",BEFORE_SEND_VISITOR_LINE:"BEFORE_SEND_VISITOR_LINE",AFTER_GET_LINES:"AFTER_GET_LINES",AFTER_LOAD_SURVEY:"AFTER_LOAD_SURVEY",AFTER_SUBMIT_SURVEY:"AFTER_SUBMIT_SURVEY",AFTER_ABANDONED_SURVEY:"AFTER_ABANDONED_SURVEY",ON_WINDOW_CLOSED:"ON_WINDOW_CLOSED",ON_ADD_TO_CART:"ON_ADD_TO_CART"};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.CsatDataGenerator=function(e){return{id:0,title:"",header:"",questions:{question:[{type:"CSAT",validationType:"csat",label:e.translate("csatRatingQuestion"),id:0,order:0,mandatory:!1}]}}};lpTag.unifiedWindow.contentTypes={TEXT_PLAIN:"text/plain",EXTERNAL_FILE:"external/file",HOSTED_FILE:"hosted/file",SECURE_FORM_INVITATION:"forms/secure-invitation",SECURE_FORM_SUBMISSION:"forms/secure-submission",SECURE_FORM_UPDATE:"forms/secure-update"};lpTag.unifiedWindow.MessageTypes={CONTENT:"ContentEvent",RICH_CONTENT:"RichContentEvent"};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.structuredContentTypes=lpTag.unifiedWindow.structuredContentTypes||{QUICK_REPLIES:"quickReplies",BUTTON:"button",LIST:"list"};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.State={INIT:"init",INITIALIZED:"initialised",PRE_CHAT:"preChat",REQUESTED:"startChat",CHATTING:"chatting",POST_CHAT:"postChat",PRE_SMS:"preSms",OFFLINE:"offline",WAITING:"waiting",PENDING:"pending",ENDED:"ended",NOT_FOUND:"notfound",APP_ENDED:"applicationEnded",ERROR:"error",RESUME:"resume",PAUSED:"paused",RESUME_PAUSED:"resumepaused",AUTH_ERROR:"authenticationError",CONNECTION_ISSUE:"connectionIssue",RESTART_AUTHENTICATION:"restartAuthentication",STEP_UP_AUTH:"stepUpAuth",INTERACTIVE:"interactive"};lpTag.unifiedWindow.Priority=function(){var e=lpTag.unifiedWindow.State,t={},i=0;t[e.INIT]=i++;t[e.INITIALIZED]=i++;t[e.PRE_CHAT]=2;t[e.OFFLINE]=i++;t[e.REQUESTED]=i++;t[e.WAITING]=4;t[e.PENDING]=4;t[e.RESUME]=4;t[e.PAUSED]=4;t[e.RESUME_PAUSED]=4;t[e.CHATTING]=i++;t[e.ENDED]=i++;t[e.POST_CHAT]=i++;t[e.NOT_FOUND]=i++;t[e.ERROR]=+i;t[e.APP_ENDED]=9;return t}();lpTag.unifiedWindow.MessageState={ERROR:"ERROR",PENDING:"PENDING",SENT:"SENT",VIEWED:"VIEWED",ACCEPT:"ACCEPT",READ:"READ",FAILED:"FAILED"};lpTag.unifiedWindow.MessagePriority=function(){var e=lpTag.unifiedWindow.MessageState,t={},i=0;t[e.ERROR]=0;t[e.PENDING]=i++;t[e.SENT]=i++;t[e.VIEWED]=i++;t[e.ACCEPT]=i++;t[e.READ]=i++;t[e.READ]=+i;t[e.FAILED]=6;return t}();lpTag.unifiedWindow.secureFormStates={SEND:"send",RECEIVED:"received",VIEWED:"viewed",VIEWED_ON_ANOTHER_TAB:"viewedOnAnotherTab",ABORTED:"aborted",SUBMIT:"submit",ERROR:"error"};lpTag.unifiedWindow.richContentStates={ACTION_EVENT:"actionEvent",PUBLISH_TEXT:"publishText",DISPLAYED:"contentDisplayed",SUBMIT_AS_TEXT:"submitAsText"};lpTag.unifiedWindow.quickRepliesStates={ACTION_EVENT:"actionEvent",PUBLISH_TEXT:"publishText"};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};lpTag.unifiedWindow.welcomeMessageStates=lpTag.unifiedWindow.welcomeMessageStates||{showTiming:{FIRST_TIME:"FIRST_TIME",EVERY_TIME:"EVERY_TIME"}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.ChatModelPath=lpTag.unifiedWindow.ChatModelPath||function(){if(!lpTag.unifiedWindow.chatModelPath){var e={name:"chatModel"},t=window.liveperson.uiframework.latest.LPModel;e.LINES=t.createPath("chat.lines",null,e.name);e.SECURE_FORMS=t.createPath("chat.secureForms",null,e.name);e.AGENT_NAME=t.createPath("chat.agentName",null,e.name);e.VISITOR_NAME=t.createPath("chat.visitorName",null,e.name);e.PARTICIPANTS=t.createPath("chat.participants",null,e.name);e.AGENT_ID=t.createPath("chat.agentId",null,e.name);e.CHAT_ID=t.createPath("chat.chatId",null,e.name);e.CURRENT_DIALOG_TYPE=t.createPath("chat.currentDialogType",null,e.name);e.AGENT_IS_TYPING=t.createPath("chat.agentIsTyping",null,e.name);e.SURVEYS_PRECHAT=t.createPath("chat.surveys.preChat",null,e.name);e.SURVEYS_EXIT=t.createPath("chat.surveys.exit",null,e.name);e.SURVEYS_OFFLINE=t.createPath("chat.surveys.offline",null,e.name);e.TTR=t.createPath("chat.ttr",null,e.name);e.TRANSCRIPT_LOADED=t.createPath("chat.transcriptLoaded",null,e.name);e.SDK_NOTIFICATIONS=t.createPath("windowsdk.notifications",null,e.name);e.SDK_BUTTON_ENABLE=t.createPath("windowsdk.buttonEnable",null,e.name);e.SURVEYS_PRESMS=t.createPath("chat.surveys.preSms",null,e.name);lpTag.unifiedWindow.chatModelPath=e}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.UIModelPath=lpTag.unifiedWindow.UIModelPath||function(){if(!lpTag.unifiedWindow.uiModelPath){var e={name:"uiModel"},t=window.liveperson.uiframework.latest.LPModel;e.STATE=t.createPath("chat.state",null,e.name);e.CONVERSATION_DATA=t.createPath("chat.conversationData",null,e.name);e.AGENT_PICTURE_URL=t.createPath("chat.agentPicUrl",null,e.name);e.VISITOR_TYPING=t.createPath("chat.isVisitorTyping",null,e.name);e.WINDOW_MAXIMIZED=t.createPath("window.maximized",null,e.name);e.ACTIONS_VISIBLE=t.createPath("window.actionsVisible",null,e.name);e.EMOJI_VISIBLE=t.createPath("window.emojisVisible",null,e.name);e.TOP_MENU_VISIBLE=t.createPath("window.topMenuVisible",null,e.name);e.WINDOW_POSITION=t.createPath("window.position",null,e.name);e.WINDOW_SOUND=t.createPath("window.sound",null,e.name);e.EMOJI_MENU=t.createPath("window.emojiMenu",null,e.name);e.WINDOW_EMBEDDED=t.createPath("window.embedded",null,e.name);e.LAST_LINE_VIEWED=t.createPath("window.lastLineViewed",null,e.name);e.ACTION_POPOUT_ENABLE=t.createPath("popout.enable",null,e.name);e.SECURE_FORMS_TAB_HANDLER=t.createPath("collaboration.secureFormsTabHandler",null,e.name);e.IDNV_DATA=t.createPath("collaboration.idnvData",null,e.name);e.WIDGET_SLIDER_VISIBLE=t.createPath("windowsdk.sliderVisible",null,e.name);e.SELECTED_WIDGET_ID=t.createPath("windowsdk.selectedWidgetId",null,e.name);e.DISPOSED_WIDGETS_IDS=t.createPath("windowsdk.disposedWidgetsIds",null,e.name);e.INITIATED_WIDGETS_IDS=t.createPath("windowsdk.InitiatedWidgetsIds",null,e.name);e.WIDGETS_NOTIICATIONS=t.createPath("windowsdk.widgetsNotifications",null,e.name);e.STEP_UP_STATE=t.createPath("chat.stepUpState",null,e.name);e.PRE_SMS_CONTEXT=t.createPath("chat.preSmsContext",null,e.name);e.LAST_VIEWED_TAB=t.createPath("tabs.lastViewedTab",null,e.name);e.TAB_LIST=t.createPath("tabs.list",null,e.name);e.SECURE_FORMS_INVITATIONS=t.createPath("collaboration.sfInvMapping",null,e.name);lpTag.unifiedWindow.uiModelPath=e}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.WidgetModelPath=lpTag.unifiedWindow.WidgetModelPath||function(){if(!lpTag.unifiedWindow.widgetModelPath){var e={name:"WidgetModelPath"},t=window.liveperson.uiframework.latest.LPModel;e.CONVERSATION_ID=t.createPath("conversation.id",null,e.name);e.SESSION_ID=t.createPath("conversation.sessionId",null,e.name);e.DIALOGS=t.createPath("conversation.dialogs",null,e.name);e.WINDOW_UI=t.createPath("ui.window",null,e.name);lpTag.unifiedWindow.widgetModelPath=e}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.ChatDelegate=lpTag.unifiedWindow.ChatDelegate||function(o,a){var s,n,r,l,d="ChatDelegate",c=lpTag.unifiedWindow.apps.CHAT,i=lpTag.unifiedWindow.apps.UNIFIED_WINDOW,u=lpTag.unifiedWindow.log,p=lpTag.unifiedWindow.State,h=lpTag.unifiedWindow.events.chat,f=(lpTag.taglets.postmessage,0),g=1,t=!1,m={state:p.INTERACTIVE,agent:!1,visitor:!1,bindId:null},v={},w=["line","leCollaboration"],_="@type",C="leCollaboration",T=lpTag.unifiedWindow.applicationUtils,E=lpTag.unifiedWindow.consts.errorTypes;function y(e){r&&r(e||{})}function b(e){l&&l(e||{})}function S(e){if(o){"string"==typeof o.svid&&(e.LETagVisitorId=o.svid);"string"==typeof o.ssid&&(e.LETagSessionId=o.ssid);"string"==typeof o.scid&&(e.LETagContextId=o.scid)}}function I(e,t,i){if(e){e.success=t;e.error=i;s.sendCollaboration(e)}u.info("sendCollaboration="+JSON.stringify(e),d)}function N(){s.cancelSurvey()}function x(e,t){n=e;p.NOT_FOUND===n&&(n=p.APP_ENDED);a.trigger({appName:c,eventName:h.STATE,data:n,global:!0});p.CHATTING===n&&a.trigger({appName:i,eventName:h.ENGAGEMENT_DATA,global:!0,data:{engagementName:o.ename,state:n}});if(t||p.WAITING===n||p.ENDED===n){v.chatState=n;M()}p.ENDED===n&&a.trigger({appName:c,eventName:h.BLOD,data:{engagementName:o.ename}})}function A(e){if("object"==typeof e){(v=v||{}).agentName=e&&e.agentName||"";v.agentId=e&&e.agentId||"";v.agentPictureUrl=e&&e.agentPictureUrl||"";v.skillName=e&&e.skillName||"";v.rtSessionId=e&&e.rtSessionId||v.rtSessionId||"";v.chatState=e&&e.chatState||v.chatState||"";v.monitoringSessionId=o&&o.ssid||v.monitoringSessionId||"";v.visitorId=o&&o.svid||v.visitorId||"";v.visitorName=e&&e.visitorName||v.visitorName||"";v.skill=o&&o.skill||v.skill||"";v.engagementId=o&&o.eid||v.engagementId||"";v.campaignId=o&&o.cid||v.campaignId||"";v.language=o&&o.lang||v.language||"";v.engagementName=o&&o.ename||v.engagementName||"";v.lastUpdate=e.lastUpdate||v.lastUpdate||"";M()}}function M(){a.trigger({appName:c,eventName:h.CHAT_INFO,data:v})}function L(e){if(!e||e.error||"ERROR"===e)a.trigger({appName:c,eventName:h.ERROR,data:{errorType:E.CONNECTION_UNAVAILABLE}});else if(!t){if(window.recaptchaRendererV2&&s.isCaptchaV2Supported&&s.isCaptchaV2Supported()){window.recaptchaRenderer=window.recaptchaRendererV2;window.recaptchaRenderer.renderCaptcha(o);window.recaptchaRendererV1.removeFromPage()}else window.recaptchaRendererV1&&(window.recaptchaRenderer=window.recaptchaRendererV1);x(p.INIT);a.trigger({appName:c,eventName:h.INITIALIZED});t=!0}}function D(e){for(var t,i=Array.isArray(e)?e:[e],n=0;ni){i=e[n].csat.endTs;t=e[n]}return t}(e.data||e);e&&e.csat&&o.trigger({appName:u,eventName:v.CSAT_INFO,data:e})}function pe(e,t){y.id=e;y.isActive=!0;E.rtSessionId=y.id;if(t&&t.conversationDetails){e=t.conversationDetails.skillId;e&&"-1"!==e?E.skill=e:"number"==typeof E.skill?E.skill=E.skill+"":E.skill=void 0}}function he(e){if(e.dialogId){b.id=e.dialogId;b.isActive=!0}else if(e.conversation){var e=e.conversation.conversationDetails&&e.conversation.conversationDetails.dialogs;if(e&&0m[l])&&e(m[t],m[f.ENDED])&&x(0,t,!0)}function Z(){u.info("_tryInitResume",c);J(function(e,t){return e<=t})}function Q(){u.info("_tryEndResume",c);J(function(e,t){return t=m[r]&&r!==t)&&x(0,t)}})}}function ee(e){u.info("_handleNewStateFromModel newState= "+e.newValue,c);var t=r;l&&r!==l&&(t=l);if(o.isInitialized()){var i=!1;if(t){if(t!==e.newValue){if(m[t]>m[e.newValue])return;if(t===f.PRE_CHAT)return o.reInit(),void 0}}else i=!0;x(0,e.newValue,i)}}function x(e,t,i){if(r!==t)switch(r=t){case f.INIT:break;case f.INITIALIZED:oe();break;case f.PRE_CHAT:A(i);break;case f.WAITING:case f.RESUME:case f.PAUSED:case f.RESUME_PAUSED:case f.CHATTING:break;case f.ENDED:ye();break;case f.POST_CHAT:i&&ye();break;case f.OFFLINE:A(i);break;case f.NOT_FOUND:case f.ERROR:Se();break;case f.APP_ENDED:u.info("_disposeApplication",c);o.disposeVisitor();n.trigger({appName:c,eventName:p.chatState.ENDED});Y();break;default:A(i)}}function A(e){e&&oe({resuming:!0})}function te(e){u.info("_submitFinalSurveyCallback: data="+JSON.stringify(e),c);_=!1;e&&e.error&&5===e.error.internalCode?n.trigger({appName:c,eventName:p.chat.SURVEY_ERROR,data:e}):e&&e.error&&10===e.error.internalCode?Ie()&&L({isInvalid:!0}):N(null,f.APP_ENDED)}function ie(e){u.info("_submitFinalSurveyError: data="+JSON.stringify(e),c);_=!1;n.trigger({appName:"survey",eventName:p.chat.SURVEY_SERVER_ERROR,data:e})}function M(e){if(e&&e.error){if(32===e.error.internalCode){P();u.info("_startChatChatError:getOfflineSurvey. internalCode: 32",c);return}if(5===e.error.internalCode)return void n.trigger({appName:c,eventName:p.chat.SURVEY_ERROR,data:e});if(10===e.error.internalCode)return Ie()&&L({isInvalid:!0}),void 0}O(e)}function ne(e){n.trigger({appName:c,eventName:p.chat.EMAIL_TRANSCRIPT_SUCCESS,data:e})}function ae(e){n.trigger({appName:c,eventName:p.chat.EMAIL_TRANSCRIPT_ERROR,data:e})}function oe(e){e=e||{};u.info("_handleInit",c);(!e.resuming&&Ie()?L:se)()}function L(e){e=e||{};window.recaptchaRenderer.showCaptcha({isInvalid:e.isInvalid,themer:a.themer,translator:a.translator,callback:se})}function se(){if(V.engConf.isOffline){P();u.info("_handleInitContinue:getOfflineSurvey. uiState.engConf.isOffline: true",c)}else a.conf.unifiedConf.skipAvailabilityCheck?de({availability:!0}):o.getAvailability(de,O)}function re(e){if(e){u.info("resumingPolling",c);o.resumePolling()}else{u.info("stopPolling",c);o.stopPolling()}}function le(e){var t;if(e.agentPictureUrl&&e.agentName){(t=s.get(v.AGENT_PICTURE_URL)||{})[e.agentName]=e.agentPictureUrl;s.modify(v.AGENT_PICTURE_URL,t)}e.skillName&&(U=e.skillName)}function de(e){u.info("_availabilitySuccess data="+JSON.stringify(e),c);if(e&&e.availability)if(T&&!ce()){u.info("_startAuthentication",c);ue({context:"onload"});a.authenticationManager.authenticate(pe,he)}else W()&&a.unAuthUserTriesAuth?he(void 0):C?o.getPreChatSurvey(me,ve):o.startChat(null,D,M);else{P();u.info("_availabilitySuccess:getOfflineSurvey. availability: false",c)}}function ce(){return s.get(v.STATE)===f.PRE_CHAT&&s.get(v.CONVERSATION_DATA)}function ue(e){u.info("_triggerProcessingEvent data="+JSON.stringify(e),c);n.trigger({appName:g.UNIFIED_WINDOW,eventName:p.application.PROCESSING,data:e})}function pe(e){u.info("_startConversation data="+JSON.stringify(e),c);if(e&&e.ssoKey){var t=j();C&&o.getPreChatSurvey(me,O);if(t&&i!==f.OFFLINE&&!ce())o.startChat({conversationData:t},D,M);else{t={domain:a.conf.unifiedConf.domain,appKey:a.keys.appKey,connectorId:a.conf.authConf.connector.id,ssoKey:e.ssoKey,redirectUri:e.redirect_uri||null,engConf:a.conf.engConf};o.startConversation(t,C?function(e){u.info("_startConversationSuccess data="+JSON.stringify(e),c);s.modify(v.CONVERSATION_DATA,e)}:function(e){u.info("_startConversationSuccess data="+JSON.stringify(e),c);o.startChat({conversationData:e},D,M)},fe)}}}function he(e){u.info("_ssoKeyError data="+JSON.stringify(e),c);ge()}function fe(e){u.info("_startConversationError data="+JSON.stringify(e),c);ge()}function ge(){if(r!==f.PRE_CHAT||W()&&a.unAuthUserTriesAuth){P();u.info("_authenticationErrorCallback:getOfflineSurvey.",c)}}function D(e){n.trigger({appName:c,eventName:p.chat.START_CHAT_INFO,data:e.info});u.info("_startChatSuccess data="+JSON.stringify(e),c)}function me(e){u.info("_getPreChatSuccess data="+JSON.stringify(e),c);e&&e.survey?Te(p.application.PRE_CHAT_SURVEY,w.SURVEYS_PRECHAT,e.survey):o.startChat(null,D,M)}function ve(e){u.info("_getPreChatError data="+JSON.stringify(e),c);o.startChat(null,D,M)}function P(){o.getOfflineSurvey(we,O)}function we(e){u.info("_getOfflineSurveyCallback data="+JSON.stringify(e),c);e&&!e.error&&e.survey?Te(p.application.OFFLINE_SURVEY,w.SURVEYS_OFFLINE,e.survey):O()}function _e(e){u.info("_getPostChatSurveyCallback, survey="+JSON.stringify(e),c);e&&!e.error&&e.survey?Te(p.application.POST_CHAT_SURVEY,w.SURVEYS_EXIT,e.survey):O()}function Ce(e){u.info("_getExitSurveyError, survey="+JSON.stringify(e),c);N(null,f.APP_ENDED)}function Te(e,t,i){i&&i.questions&&i.questions.question&&i.questions.question.forEach(function(e){e.label=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml(e.label).cleanText;e.entry&&e.entry.forEach(function(e){e.displayValue=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml(e.displayValue).cleanText})});lpTag.hooks&&lpTag.hooks.exec&&(i=(e=lpTag.hooks.exec({name:lpTag.unifiedWindow.hooks.AFTER_GET_SURVEY,data:{surveyType:e,surveyData:i}}))&&e.data&&e.data.surveyData||i);B.modify(t,i)}function Ee(e){u.info("_stateListener state="+e,c);N(null,e)}function O(e){u.info("_changeToError err= "+JSON.stringify(e),c);N(e,h.ERROR)}function ye(){u.info("_checkForPostChatSurvey",c);!function(){var e;e=!(!E&&F.skill===U)&&(!0===R.postChatSurveyOnNonInteractiveChat||o.isInteractive());return e}()?N(null,f.APP_ENDED):o.getExitSurvey(E,_e,Ce)}function be(){o.setVisitorTyping(!1);o.endChat(null,O)}function Se(){u.info("_handleError",c);N(null,f.APP_ENDED)}function Ie(){return window.recaptchaRenderer}function W(){var e=a&&a.conf&&a.conf.unifiedConf,t=e&&e.external,e=e&&e.authPostVerificationLiveChat;return!t&&e}this.emailTranscript=function(e,t){e&&o.emailTranscript(e,t,ne,ae)};this.getCurrentState=z;this.getOTK=function(e,t){return o.getOTK(e,t)};this.richContentRequest=function(e,t){u.info("richContentRequest info: "+JSON.stringify(e),c);o.richContentRequest(e,t=t||[])};this.secureFormRequest=function(e,t,i,n){return o.secureFormRequest(e,t,i,n)};this.getOtkJson=function(e){return JSON.stringify({siteId:lpTag.site,chatId:o.getSessionKey&&o.getSessionKey()})};this.dispose=Y};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.SMSDeflectionManager=lpTag.unifiedWindow.SMSDeflectionManager||function(e,t,i,n){var r,a,o,l,s=lpTag.unifiedWindow.apps.CHAT,d=lpTag.unifiedWindow.events.chat,c=lpTag.unifiedWindow.chatModelPath,u=lpTag.unifiedWindow.uiModelPath,p=lpTag.unifiedWindow.apps,h=lpTag.unifiedWindow.events,f=t.chatModel,g=t.uiModel,m=i.engConf||{},v=lpTag.unifiedWindow.consts,w=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml||function(e){return{cleanText:e}},t=(l=new lpTag.unifiedWindow.helpers.SMSFormHelper,n);r=t.apiDelegate;a=t.appContext;(o=t.events).bind({appName:s,eventName:d.INITIALIZED,func:_});o.bind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM,func:C});o.bind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM_EXIT,func:T});r.initialize();function _(){r.getPreSMSForm(function(e){if(e.error)E();else{g.modify(u.STATE,lpTag.unifiedWindow.State.PRE_SMS);f.modify(c.SURVEYS_PRESMS,l.transform(e))}},function(e){E()})}function C(t){if(t&&t.survey){var e=m.externalTargets&&m.externalTargets[v.externalTargets.SMS]&&m.externalTargets[v.externalTargets.SMS].brandIdentifier,i=f.get(c.SURVEYS_PRESMS),n=l.getAnswerOfType(i,t.survey.question,l.TYPES.PHONE_NUMBER),a=l.getAnswerOfType(i,t.survey.question,l.TYPES.FIRST_NAME),o=l.getAnswerOfType(i,t.survey.question,l.TYPES.LAST_NAME),i=l.getAnswerOfType(i,t.survey.question,l.TYPES.MESSAGE);if(n&&e){var s={Body:i?w(i.answer).cleanText:"",From:n.answer,To:e,context:{engagementId:m.eid,campaignId:m.cid,visitorId:m.svid,visitorFirstName:w(a).cleanText?a.answer:"",visitorLastName:o?w(o.answer).cleanText:""}};m.skillId&&(s.context.skillId=m.skillId);r.submitPreSMSForm(s,function(e){g.modify(u.PRE_SMS_CONTEXT,s);g.modify(u.STATE,lpTag.unifiedWindow.State.APP_ENDED);b(t.survey,"success");y()},function(){E();b(t.survey,"fail")})}else E()}else{g.modify(u.STATE,lpTag.unifiedWindow.State.APP_ENDED);y()}}function T(){y();o.trigger({appName:s,eventName:h.viewController.INITIATE_END_CHAT})}function E(){g.modify(u.STATE,lpTag.unifiedWindow.State.CONNECTION_ISSUE)}function y(){o.unbind({appName:s,eventName:d.INITIALIZED,func:_});o.unbind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM,func:C})}function b(e,t){lpTag.hooks&&lpTag.hooks.exec&&lpTag.hooks.exec({name:lpTag.unifiedWindow.hooks.AFTER_SUBMIT_SURVEY,data:{context:a,surveyType:lpTag.unifiedWindow.SurveyType.PRE_SMS,surveyData:e,status:t}})}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.ConversationManager=lpTag.unifiedWindow.ConversationManager||function(k,n,V,$){var F,B,v,U,H,z,G,j,q,s,w,r,l,o,K,Y,d,t,c,u,X,J,Z,Q,p="ConversationManager",h=lpTag.unifiedWindow.apps.CHAT,f=lpTag.unifiedWindow.log,g=lpTag.unifiedWindow.events,m=lpTag.unifiedWindow.uiModelPath,_=lpTag.unifiedWindow.chatModelPath,C=g.chat,ee=g.viewController,T=lpTag.unifiedWindow.State,te=lpTag.unifiedWindow.apps,ie=lpTag.unifiedWindow.consts,a=lpTag.unifiedWindow.consts.chatEvents,e=lpTag.unifiedWindow.events.socket,E=lpTag.AMSStatics.conversation.states,y=lpTag.AMSStatics.dialog,b=lpTag.unifiedWindow.secureFormStates,ne=lpTag.AMSStatics.participant.roles,ae=lpTag.unifiedWindow.consts.errorTypes,oe=lpTag.unifiedWindow.consts.authErrorsTypes,se=lpTag.unifiedWindow.MessageState,S=lpTag.unifiedWindow.contentTypes,re=lpTag.unifiedWindow.MessageTypes,le=lpTag.unifiedWindow.settingsIDs,de=lpTag.unifiedWindow.structuredContentTypes,ce=lpTag.unifiedWindow.quickRepliesStates,ue=lpTag.unifiedWindow.welcomeMessageStates,pe=0,he=4,I=2,fe=3,N=null,x={SYSTEM:"system",AGENT:"agent",VISITOR:"visitor"},ge=!1,me=!1,ve=15e3,we=null,_e=3e5,Ce=lpTag.AMSStatics.dialog.closeReasons,Te=!1,Ee=!1,ye=!1,A={},M={},L={},D={},be={},P={},O=lpTag.unifiedWindow.applicationUtils,Se=[],Ie="@id",Ne=!1,xe=!1,Ae={},Me={},W=[],Le=(lpTag.csds,{csds:{acCdnDomain:"acCdnDomain",acCdnDomainConsumerSdk:"acCdnDomainConsumerSdk",leCdnDomain:"leCdnDomain"},storage:{unauthStorage:{key:"-unAuthJWT",name:"unAuthMessaging"},stepUpStorage:{appName:"StepUP",valueKeys:{lastActiveConvo:"lastActiveConvo"}}}}),De=!1,i=(Me[a.SECURE_FORM]=!0,$);f.info("init",p);r=n.uiModel;l=n.chatModel;F=i.stepUpManager;n=i.canEnableOfflineFlow;var Pe=i;o=Pe.apiDelegate;w=Pe.appContext;s=Pe.events;t=Pe.authenticationData;X=Pe.appContext.featureStateManager;J=Pe.appContext.uiStateManager;De=X.checkSetting(le.BLOCK_CONSUMER,"true");s.bind({appName:"SessionManager",eventName:C.NO_SESSION,func:Yt});s.bind({appName:h,eventName:e.CONNECTED,func:Be});s.bind({appName:h,eventName:e.INITIALIZED,func:Ue});s.bind({appName:h,eventName:e.DISCONNECTED,func:ze});s.bind({appName:h,eventName:e.NON_RESPONSIVE,func:Ge});s.bind({appName:h,eventName:e.PING_SUCCESS,func:He});s.bind({appName:h,eventName:C.USER_INFO,func:Je});s.bind({appName:h,eventName:C.USER_LEFT,func:Ze});s.bind({appName:te.UNIFIED_WINDOW,eventName:g.application.POST_CHAT_SURVEY,func:Ut});s.bind({appName:te.UNIFIED_WINDOW,eventName:g.application.END_CHAT,func:Gt});s.bind({appName:h,eventName:C.CONVERSATION_STATE,func:ct});s.bind({appName:h,eventName:C.DIALOG_STATE,func:ut});s.bind({appName:h,eventName:C.CSAT_INFO,func:ot});s.bind({appName:h,eventName:C.CONVERSATION_CONTENT,func:Tt});s.bind({appName:h,eventName:C.SUBSCRIBE_MESSAGING_EVENTS_RESPONSE,func:Et});s.bind({appName:h,eventName:C.CONVERSATION_HISTORY,func:Rt});s.bind({appName:"*",eventName:C.AUTHENTICATION_ERROR,func:rt});s.bind({appName:h,eventName:C.NEW_CONVERSATION_REQUESTED,func:Kt});s.bind({appName:"*",eventName:ee.CONVERSATIONS_VIEWED,func:kt});s.bind({appName:"*",eventName:ee.RETRY_GET_HISTORY,func:bt});s.bind({appName:"*",eventName:C.FORGET_ME,func:st});s.bind({appName:"API",eventName:C.DELETE_CONVERSATION_SUBSCRIPTION,func:Xt});s.once({appName:h,eventName:C.CONVERSATION_OWNER_BRAND_INFO,func:Jt});s.bind({appName:"*",eventName:"pendingLineSet",func:Ve});s.bind({appName:"AMSClient",eventName:C.CONVERSATION_STEP_UP,func:$e});lpTag.events&&lpTag.events.bind({appName:"*",eventName:C.SIGNAL_OUT,func:ke});Fe();n?Bt():We(t);i=w&&w.conf&&w.conf.unifiedConf;B=i&&i.isWelcomeMessageForAgentEnabled||!0;Q=Number(i&&i.timePeriodToLoadHistoryFromUMS);we=Number(i&&i.messagingNotificationTimeout)||5e3;function Oe(){s.unbind({appName:"SessionManager",eventName:C.NO_SESSION,func:Yt});s.unbind({appName:h,eventName:e.CONNECTED,func:Be});s.unbind({appName:h,eventName:e.INITIALIZED,func:Ue});s.unbind({appName:h,eventName:e.DISCONNECTED,func:ze});s.unbind({appName:h,eventName:e.NON_RESPONSIVE,func:Ge});s.unbind({appName:h,eventName:e.PING_SUCCESS,func:He});s.unbind({appName:h,eventName:C.USER_INFO,func:Je});s.unbind({appName:h,eventName:C.USER_LEFT,func:Ze});s.unbind({appName:te.UNIFIED_WINDOW,eventName:g.application.POST_CHAT_SURVEY,func:Ut});s.unbind({appName:te.UNIFIED_WINDOW,eventName:g.application.END_CHAT,func:Gt});s.unbind({appName:h,eventName:C.CONVERSATION_STATE,func:ct});s.unbind({appName:h,eventName:C.DIALOG_STATE,func:ut});s.unbind({appName:h,eventName:C.CONVERSATION_CONTENT,func:Tt});s.unbind({appName:h,eventName:C.SUBSCRIBE_MESSAGING_EVENTS_RESPONSE,func:Et});s.unbind({appName:h,eventName:C.CONVERSATION_HISTORY,func:Rt});s.unbind({appName:h,eventName:C.CSAT_INFO,func:ot});s.unbind({appName:"*",eventName:C.AUTHENTICATION_ERROR,func:rt});s.unbind({appName:h,eventName:C.NEW_CONVERSATION_REQUESTED,func:Kt});s.unbind({appName:"*",eventName:ee.CONVERSATIONS_VIEWED,func:kt});s.unbind({appName:"*",eventName:ee.RETRY_GET_HISTORY,func:bt});s.unbind({appName:"*",eventName:C.FORGET_ME,func:st});s.unbind({appName:"*",eventName:"pendingLineSet",func:Ve});s.unbind({appName:"AMSClient",eventName:C.CONVERSATION_STEP_UP,func:$e});lpTag.events&&lpTag.events.unbind({appName:"*",eventName:C.SIGNAL_OUT,func:ke})}function We(e){if(t=e){f.info("authenticate with data: "+JSON.stringify(t),p);t.type=t.type||O.getPropertyFromObject($,"appContext.conf.authConf.stepUpConnector.type")||O.getPropertyFromObject($,"appContext.conf.authConf.connector.type");Xe(t)}else{f.info("authenticate - error - no authentication data",p);lt()}}function Re(e){var t=M[e];return A[t]&&A[t].dialogs[e].state===y.states.OPEN}function ke(e){var t=w&&w.conf&&w.conf.unifiedConf;t&&!t.isSignalEnabled||o&&"function"==typeof o.sendSignaledEvent&&o.sendSignaledEvent(e.payload)}function Ve(e){Z=!!e.serverPendingLineExists}function $e(){var e=w&&w.conf&&w.conf.unifiedConf;e&&(e.isConvoSteppedUp=!0)}function Fe(){K={agent:!1,visitor:!1}}function Be(){f.info("_handleSocketConnected",p);F.sendStepUp();He();je()}function Ue(){f.info("_handleSocketInitialized",p);if(Te)qe(q);else if(!me){me=!0;s.trigger({appName:h,eventName:C.INITIALIZED});Ee=!0;o.getMyUserProfile();o.getBrandProfile();R(T.REQUESTED,null)}}function He(){if(ge){ge=!1;if(U&&r.get(m.STATE)===T.CONNECTION_ISSUE){G.dialogId=z;ut(G);R(U)}}}function ze(){f.info("_handleSocketDisconnected",p);xe=!0;L={};q=null;j||ge||(j=setTimeout(function(){Ge()},ve))}function Ge(){if(!ge){ge=!0;L={};H=mt();z=gt();A[H]&&A[H].dialogs&&A[H].dialogs[z]&&(G=lpTag.unifiedWindow.applicationUtils.clone(A[H].dialogs[z]));ct({convId:mt(),state:T.CONNECTION_ISSUE});ut({dialogId:gt(),state:T.CONNECTION_ISSUE});je();U=r.get(m.STATE);Ee?R(T.CONNECTION_ISSUE):dt()}}function je(){clearTimeout(j);j=null}function qe(e){e&&o.unsubscribeConversations(e);o.subscribeConversations(et)}function Ke(){!w.conf.unifiedConf.poppedOut&&!w.conf.unifiedConf.external||w.conf.unifiedConf.connectorsSfConfig&&w.conf.unifiedConf.connectorsSfConfig.isFormSubmitted?Ye(Xe):Te?R(T.RESTART_AUTHENTICATION,null):window.location.href=w.appConfigurationManager.getExternalResourceURL(w.conf.engConf,w.conf.unifiedConf,w.conf.unifiedConf.poppedOut)}function Ye(e){if(he<=pe)lt();else{pe++;f.info("_restartAuthentication",p);w.authenticationManager.reAuthenticate(e,Ye.bind(this,e))}}function Xe(e){f.info("_ssoKeySuccess data="+JSON.stringify(e),p);var t=e&&e.ssoKey||null,i=e&&e.redirect_uri||null,n=e&&e.type||O.getPropertyFromObject(w,"conf.authConf.stepUpConnector.type")||O.getPropertyFromObject(w,"conf.authConf.connector.type")||null,e=e&&e.code_verifier,a=F&&F.getStepUpFailedStatus();O.getPropertyFromObject(w,"conf.engConf.allowUnauthMsg")?o.createMessagingInstance({authCode:t,redirect_uri:i,authType:n,pingTimeout:ve,forceNewConfig:a,blockHistory:De}):o.createMessagingInstance({authCode:t,redirect_uri:i,authType:n,pingTimeout:ve,forceNewConfig:a,codeVerifier:e})}function Je(e){var t=e;if(t){var e={id:t.userId,type:function(e){var t;if("string"==typeof e.type)switch(e.type){case"CONTROLLER":t=x.SYSTEM;break;case"CONSUMER":t=x.VISITOR;break;default:t=x.AGENT}else t=e.role?x.AGENT:x.VISITOR;return t}(t),name:t.name,imgUrl:t.imgUrl},i=!1;e.name||(e.type===x.VISITOR?e.name=t.firstName||t.lastName?t.firstName+" "+t.lastName:w.translator.translate("you"):e.name=w.translator.translate("agent"));!function(e,t){var i=l.get(_.PARTICIPANTS)||{};i[e.id]=e;l.modify(_.PARTICIPANTS,i);if(t&&t.dialogId){e=M[t.dialogId];if(e&&A[e]){i=A[e].dialogs[t.dialogId];i&&i.participants&&(i.participants.some(function(e){return e.id===t.userId})||i.participants.push({id:t.userId,role:t.type}))}}}(e,t);switch(e.type){case x.VISITOR:l.get(_.VISITOR_NAME)||(i=!0);break;case x.AGENT:Qe(t)&&(i=!0)}i&&at(e)}if(!Te){qe(q);me=!(Te=!0)}}function Ze(t){Qe(t)&&nt();if(t&&t.dialogId){var e=M[t.dialogId];if(e&&A[e]){e=A[e].dialogs[t.dialogId];if(e&&e.participants){var i=e.participants.some(function(e){return e.id===t.pid});if(i){i=e.participants.indexOf(i);"number"==typeof i&&e.participants.splice(i,1)}}}}}function Qe(e){return e&&(e.type===ne.ASSIGNED_AGENT||e.type===ne.AGENT)&&e.dialogId&&Re(e.dialogId)}function et(e){pe=0;q=e.subscriptionId}function tt(){var e=w.themer&&w.themer.getStyle("openingMessage","text"),i={source:x.AGENT,by:w.translator.translate("info"),isWelcomeMessage:!0};if(u=w.conf.windowConf&&w.conf.windowConf.welcomeMessage){w.shouldWelcomeMessageBeSent=!0;i.text=u.text;if(u.quickReplies&&0=fe){yt(a,!0);if(function(e){e=M[e];return A[e].state===E.OPEN}(n))dt();else{It();0===Object.keys(L).length&&be[ht(v[0].convId)]&&It(w.conf.unifiedConf.failedToLoadHistory=!0)}}else{P[n]?P[n].retries++:P[n]={retries:1};$t(n)!==a&&yt(a)}}}else{t=L[e.reqId].dialogId;i=1;if(!O.isEmpty(P)&&P[t]){i=P[t].retries;delete P[t]}n=L[e.reqId].resubscribe;yt(e.reqId);delete be[t];a=setTimeout(function(){P[t]||(P[t]={retries:i});Tt({dialogId:t})},we);D[t]={dialogId:t,timeoutId:a,resubscribe:n}}}function yt(e,t){if(t&&L[e]&&L[e].dialogId){be[L[e].dialogId]=L[e];t=L[e].dialogId;t=St(t,!1);A[t].returnedDialogs.allDialogsSuccessful=!1}delete L[e]}function bt(e){if(O.isEmpty(be))kt(e);else for(var t in be)be.hasOwnProperty(t)&&$t(t)}function St(e,t){if(!e)return null;var i=M[e];if(i&&A[i]){A[i].returnedDialogs||(A[i].returnedDialogs={allDialogsSuccessful:!1});A[i].returnedDialogs[e]||(A[i].returnedDialogs[e]={});A[i].returnedDialogs[e].successful=t}return i}function It(e){if(0===Object.keys(L).length&&0===Object.keys(D).length||e){var e=gt()?T.CHATTING:T.WAITING,t=function(){var i,n=[];Array.isArray(Se)&&Se.forEach(function(e,t){i=function(e){var t=function(e){var t=e&&e.event||{};{if(t.type!==re.RICH_CONTENT){var i=e,n=i&&i.event||{};!function(e){return!(!Ae[e.sequence]||e.state!==se.VIEWED&&e.state!==se.ERROR)}(i)||(n.contentType=S.SECURE_FORM_UPDATE);switch(n.contentType){case S.HOSTED_FILE:return function(e,t){return{type:t,subType:"REGULAR",fileData:e,textType:"file"}}(n.message,S.HOSTED_FILE);case S.EXTERNAL_FILE:return Mt(w.translator.translate("transcriptForPhotoSharingImage"),a.LINE);case S.TEXT_PLAIN:return Mt(n.message||"",a.LINE,n.quickReplies);case S.SECURE_FORM_INVITATION:return Lt(i,b.SEND);case S.SECURE_FORM_SUBMISSION:return Lt(i,b.SUBMIT);case S.SECURE_FORM_UPDATE:return Lt(i,i.state);default:return Mt("string"==typeof n.message?n.message:"",a.LINE)}return}return Mt(t.content,a.RICH_CONTENT,t.quickReplies)}}(e);!function(e,t){var i=Dt(t)||{};e[Ie]=t.sequence;e.sequenceId=t.sequence;e.originatorId=i.id;e.by=i.name;e.source=i.type;e.time=t.serverTimestamp;e.convId=t.dialogId;e.track=function(e){var t=M[e.dialogId];if(At(e)&&N&&v[N]&&t===v[N].convId&&e.dialogId===function(e){if(A[e]&&A[e].dialogs&&A[e].sortedDialogIds)for(var t=0;ti);a++)n.push(e[a]);return n}(e)).length){Vt(e,0,e.length-1,!1);v=e.concat(v);N+=e.length}return e}(e),i=e;if(0<(i=function(e){var t,i;t=v&&0=ie.fifteenMinutesInMS?Q:ie.fifteenMinutesInMS;var m=Date.now()-Q,g=A[u].endTime&&A[u].endTimet?i.nextOn-t:null:i.nextOff&&i.nextOff>t?i.nextOff-t:null}if("number"==typeof n){e=Math.min(n+v,36e5);o&&clearTimeout(o);o=setTimeout(g.isEmpty(i)?y:b,e)}return a}(i.delay,n,t);return i}(f.brandInfo,f.shiftStatus),t=function(e){return{isUrgent:e.ttrType===d.urgent,isPrioritized:e.ttrType===d.prioritized,isManual:!!e.manualETTR}}(f.urgencyInfo);e={isUrgent:t.isUrgent,markUrgencyEnabled:!e.onOffHours&&!t.isManual&&!t.isPrioritized};i.modify(c.TTR,e)}var e,t}function b(){t.getShiftStatus({success:S,error:S})}function S(e){var t=e&&e.body;(m=!g.isEmpty(t)&&200===e.statusCode&&200===e.responseCode)&&(f.shiftStatus=t);y()}this.dispose=function(){a.unbind({appName:r,eventName:l.BRAND_INFO,func:T});n.unbind(u.STATE,C);i.unbind(c.TRANSCRIPT_LOADED,y);w()}};window.lpTag=window.lpTag||{};lpTag.unifiedWindow=lpTag.unifiedWindow||{};lpTag.unifiedWindow.HeartBeatManager=lpTag.unifiedWindow.HeartBeatManager||function(e,t){var i,n,a,o,s,r,l,d,c,u,p,h,f,g,m,v=lpTag.unifiedWindow.log,w=lpTag.unifiedWindow.apps,_=w.HEARTBEAT,C=lpTag.unifiedWindow.events,T="UIHeartBeatEmbedded",E="UIHeartBeatPopOut",R=6e4,k=15e3,V=15e3,$=2e3,y=1e3,b=w.UNIFIED_WINDOW;v.info("init",_);if("object"==typeof e&&e.accountId&&e.storageKey&&e.secureStorageLocation&&"object"==typeof t){n=e.accountId;r=e.storageKey;a=e.poppedOut;m=e.secureStorageLocation;g=t.events;f=t.browserStateManager;g.bind({appName:w.UISTATE,eventName:C.uiState.EMBEDDED_CHANGED,func:N});if(a)!function(){I(!0);A(C.heartBeat.INIT)}();else{!function(){v.info("_fetchEmbeddedBeat",_);lpTag.taglets.lpSecureStorage.getValue({key:r,site:n,app:b,success:F,appName:T,domain:m,firstParty:!0})}();!function(){v.info("_fetchPopOutBeat",_);lpTag.taglets.lpSecureStorage.getValue({key:r,site:n,app:b,success:M,appName:E,domain:m,firstParty:!0})}()}}else v.error("No configuration received on init",_);function S(e){v.info("_stop ,preserveTimestamps: "+e,_);c=!0;v.info("_clearTimeouts",_);l&&clearTimeout(l);u&&clearTimeout(u);if(!a&&!e){v.info("_clearTimestamps",_);M();L()}d=!1}function I(e){v.info("_start, preserveTimestamps: "+e,_);i=(new Date).getTime();S(e);v.info("_resolveApps: initializing apps value - poppedOut = "+a,_);if(a){o=T;s=E}else{o=E;s=T}v.info("_resolveApps: resolvedGetApp = "+o+", resolvedSetApp = "+s,_);v.info("_startBeating",_);d=!(c=!1);P(B);O()}function N(e){v.debug("_handleEmbeddedStateChange: embedded="+e,_);e?S():I(!0)}function x(){A(a?C.heartBeat.FAILED:C.application.DO_HARAKIRI)}function A(e,t){g.trigger({appName:_,eventName:e,data:t})}function M(e){v.info("_initPopOutBeat: "+JSON.stringify(e),_);if(!e||!e.timestamp){v.info("_initPopOutBeat: initializing popout beat value",_);lpTag.taglets.lpSecureStorage.setValue({key:r,site:n,app:b,value:W(0),success:D,error:D,appName:E,domain:m,firstParty:!0})}}function L(){lpTag.taglets.lpSecureStorage.setValue({key:r,site:n,app:b,value:W(0),success:D,error:D,appName:T,domain:m,firstParty:!0})}function F(e){v.info("_initEmbeddedBeat: data="+JSON.stringify(e),_);if(!e||!e.timestamp){v.info("_initEmbeddedBeat: initializing embedded beat value",_);L()}}function D(){v.info("_emptyCallback",_)}function P(e){v.info("_getBeat: got beat",_);l&&clearTimeout(l);c||(a||f.visibilitySupported()&&!f.isHidden()?lpTag.taglets.lpSecureStorage.getValue({key:r,site:n,app:b,success:e,appName:o,domain:m,firstParty:!0}):l=setTimeout(U(e),y))}function B(e){v.info("_validateBeat: data="+JSON.stringify(e),_);var t=(new Date).getTime();if(!c)if(!(a||e&&e.timestamp)&&k{{text}}',c={attrs:{type:"data-lp-collab-type",payload:"data-lp-collab-payload",action:"data-lp-action",questionType:"idnv_question",answerType:"idnv_answer"},states:{PENDING:"pending",CANCELLED:"cancelled",SUBMITTED:"submitted",SKIPPED:"skipped"}};t.info("init",i);if("object"==typeof e){n=e.appContext;a=e.lppModel}else t.error("init: missing mandatory dependencies.",i);function u(e){return p(n.translator.dictionary.getString("idnvFormCancelled"),e,!1)}function p(e,t,i){var n;i&&(n=c.attrs.action+'="mask"');return o.injectTextObj(d,{payload:t,mask:n,text:e})}function h(e,t){a.modify(l.IDNV_DATA.path+"."+e+".state",t)}function f(e){n.transcriptManager.sendLineSkipLocal({text:e},{error:function(){n.events.trigger({appName:"tooltip",eventName:"show",data:{text:n.translator.translate("idnvSendLineError"),tooltipTimeout:s}})}})}function g(e){var e=e.match(//g);return e&&e[0]&&(e=lpTag.lpUtils.getAttrValue(e[0],c.attrs.payload))?{encodedFields:e,fields:JSON.parse(decodeURIComponent(e))}:null}function m(e,t){t={context:this,data:{ControllerName:lpTag.unifiedWindow.IdnvDialogViewController.ControllerName,idnvData:t,dialogOpenedFrom:this}};n.events.trigger({appName:i,eventName:e,data:t})}this.isIdnvLineObj=function(e){return!!(e.text&&e.text.indexOf&&(-1)/g;n.info("init",i);o=e.lpModel;s=e.lppModel;r=e.wsdkModel;lpTag.LPWidgetSDK.API;t=e.events;l=e.windowSDKEvents;a=e.appContext;d=lpTag.unifiedWindow.consts.widgetSDK;u=p.getPropertyFromObject(a,"conf.engConf.async");lpTag.unifiedWindow.State;!function(){t.bind({appName:"*",eventName:f.widgetSDK.INIT,context:this,func:w});g.push(t.bind({appName:"*",eventName:f.widgetSDK.VISITOR_TYPING,context:this,func:D}));g.push(t.bind({appName:"*",eventName:f.chat.LINE,context:this,func:O}));g.push(t.bind({appName:"*",eventName:f.chat.CHAT_INFO,context:this,func:E}));g.push(t.bind({appName:"*",eventName:f.chat.STATE,func:N}));g.push(t.bind({appName:"slider",eventName:f.viewController.SLIDER_VIEW_CHANGE,context:this,func:x}));g.push(t.bind({appName:"slider",eventName:f.viewController.SLIDER_CLOSED,context:this,func:A}));g.push(t.bind({appName:"WrapperWindowExtender",eventName:f.viewController.MINIMIZE_VISIBLE,context:this,func:function(){P(!1)}}));g.push(t.bind({appName:"WrapperWindowExtender",eventName:f.viewController.MAXIMIZE_VISIBLE,context:this,func:function(){P(!0)}}));l.bind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.NOTIFICATION,context:this,func:T});l.bind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.INITIATED_WIDGET_ID,context:this,func:_});o.bind(lpTag.unifiedWindow.chatModelPath.AGENT_IS_TYPING,L)}();function w(){l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.INIT})}function _(e){var t=s.get(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS)||{};t[e]=!0;s.modify(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS,t);o.modify(lpTag.unifiedWindow.chatModelPath.SDK_BUTTON_ENABLE,!0)}function C(){var e=s.get(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS),t=s.get(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS);if(t&&e)for(var i in t)e[i]=!1;return e||{}}function T(e){"number"==typeof e&&0<=e&&o.modify(lpTag.unifiedWindow.chatModelPath.SDK_NOTIFICATIONS,e)}function E(e){if(e&&(c=e.rtSessionId&&!c?e.rtSessionId:c)){var t=e,i=r.get(h.CONVERSATION_ID),n=r.get(h.SESSION_ID);!i&&t.rtSessionId&&r.modify(h.CONVERSATION_ID,t.rtSessionId);!n&&t.monitoringSessionId&&r.modify(h.SESSION_ID,t.monitoringSessionId);y(e,I(c));if(e.agentName&&e.agentId||e.visitorId&&e.visitorName){i=e;i.agentName&&i.agentId&&b({id:i.agentId,name:i.agentName,type:d.AGENT,imgPath:p.getPropertyFromObject(a,"conf.windowConf.agentUrl")||"",description:p.getPropertyFromObject(a,"conf.windowConf.description")||""});i.visitorId&&i.visitorName&&b({id:i.visitorId,name:i.visitorName,type:d.VISITOR})}}}function y(e,t){var i=r.get(h.CONVERSATION_ID),n=r.get(h.SESSION_ID),a=!1;if(t&&e){if(e.state&&t.state!==W(e.state)){t.state=W(e.state);a=!0}if(!t.startTime&&e.lastUpdate){t.startTime=e.lastUpdate;a=!0}if(e.skill&&(!t.skill||t.skill.name!==e.skill&&t.skill.id!==e.skill)){t.skill=u?{name:"",id:e.skill}:{name:e.skill,id:""};a=!0}if(e.typing){t.typing=e.typing;a=!0}if(a){r.modify(h.DIALOGS,[t],"id");l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.CONVERSATION_INFO,data:{conversationId:i,sessionId:n,dialogId:t.id,startTime:t.startTime,state:t.state,dialogType:t.dialogType,channelType:t.channelType,skill:t.skill,typing:t.typing}})}}}function b(e){for(var t,i=I(c),n=!1,a=0;a")}return t}(e.text);i.originator={type:e.source,name:e.by};i.state=e.state;break;case f.chat.CHAT_INFO:}return i}(e,f.chat.LINE);if(t){var i=t,n=I(c);if(n&&(n.state===lpTag.WindowSDKAPI.states.ACCEPTED||n.state===lpTag.LPWidgetSDK.API.states.IN_QUEUE)){i.originator&&(i.originator.type===d.VISITOR?m.visitor=!0:i.originator.type===d.AGENT&&(m.agent=!0));m.agent&&m.visitor&&y({state:lpTag.LPWidgetSDK.API.states.INTERACTIVE},n)}if(i=I(e.convId)){i.messages.push(t);r.modify(h.DIALOGS,[i],"id")}l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.MESSAGES,data:t})}}function W(e){var t=lpTag.unifiedWindow.State,i=lpTag.LPWidgetSDK.API.states;switch(e){case t.PRE_CHAT:return i.PRE_CONVERSATION;case t.WAITING:case t.REQUESTED:return i.PENDING;case t.CHATTING:return u?i.IN_QUEUE:i.ACCEPTED;case t.POST_CHAT:return i.POST_CONVERSATION;case t.ENDED:return i.CONVERSATION_ENDED;case t.OFFLINE:return i.OFFLINE;case t.ERROR:case t.NOT_FOUND:return i.ERROR;default:return e}}this.dispose=function(){n.info("dispose",i);g.forEach(function(e){t.unbind(e)});l.unbind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.NOTIFICATION,context:this,func:T})};this.getWidgetsStatus=C;this.getLastShownWidgetId=function(){var e=s.get(lpTag.unifiedWindow.uiModelPath.SELECTED_WIDGET_ID),t=s.get(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE);if(e&&t)return e};this.getWidgetsNotifications=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS)||{}};this.getLastSliderState=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE)};this.isWindowMaximized=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WINDOW_MAXIMIZED)};this.setWIdgetsNotifications=function(e){s.removeKey(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS);s.modify(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS,e)};this.handleWidgetDisposal=function(e){var t,i,n=s.get(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS)||{},a=!1;n[e]=!1;s.modify(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS,n);for(i in t=C())if(!0===t[i]){a=!0;break}a||o.modify(lpTag.unifiedWindow.chatModelPath.SDK_BUTTON_ENABLE,!1)};this.onWidgetStateChanged=function(e){s.modify(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE,e)}};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow.AuthenticationManager=window.lpTag.unifiedWindow.AuthenticationManager||function(e){var d,c="AuthenticationManager",u=lpTag.unifiedWindow.log,p=lpTag.taglets.authenticator,h=lpTag.taglets.lpUtil;d=e.appContext;function f(){var e=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector),e=d.conf.unifiedConf.useOAuth2Standard||e&&e.configuration&&e.configuration.rfcCompliance;return d.conf.authConf&&d.conf.authConf.redirect_uri?d.conf.authConf.redirect_uri:e&&d.conf.unifiedConf.external?lpTag.lpUtils.getCurrentUrlWithoutParams():lpTag.unifiedWindow.consts.defaultRedirectUri}function g(t){return function(e){e&&(e.redirect_uri=e.redirect_uri||f());t(e)}}this.authenticate=function(e,t){u.info("authenticate",c);var i=d.conf.unifiedConf.authToken||d.conf.unifiedConf.poppedOut,n=d.conf.engConf.async&&d.conf.authConf&&d.conf.authConf.ssoKey,a=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector),o=a&&a.configuration&&a.configuration.pkceEnabled;if(p){var s=f(),r=d.conf.uiState&&d.conf.uiState.chat&&"restartAuthentication"===d.conf.uiState.chat.state,l=decodeURIComponent(window.location.href);if(o&&(i||n)&&r&&d.conf.unifiedConf.external&&!l.match('"pkce_reauthentication":1')){r=d.pkceManager.getExternalWindowURLForPKCE(d);window.location.href=r}else if(i)h.runCallback(e,null,{ssoKey:d.conf.unifiedConf.authToken,redirect_uri:s});else if(n)h.runCallback(e,null,{ssoKey:d.conf.authConf.ssoKey,redirect_uri:s});else if(d.conf.unifiedConf.pkceRedirectUrl)d.pkceManager.generatePKCE(function(e){if(e){localStorage.setItem("cv",e.code_verifier);window.location.href=d.conf.unifiedConf.pkceRedirectUrl+"&code_challenge="+e.code_challenge+"&code_challenge_method=S256"}});else{if(!function(e){e=e&&e.configuration;return!e||"lpTag.taglets.unAuthMessaging"===e.jsContext&&"lpTag.taglets.unAuthMessaging.lpUnauthFunction"===e.jsMethodName}(a)&&d.conf.unifiedConf.connectors&&d.conf.unifiedConf.connectors.length){l=function(){var i,e=window.lpTag.identities&&lpTag.identities.safeIdentities||[],t=d.conf.unifiedConf.connectors,n=e.filter(function(e){var e=e.acr,t=parseInt(e,10);return 1!==e.length||0!==t});n.length&&t.forEach(function(t){n.forEach(function(e){t.configuration.issuer===e.iss&&(i=t)})});return i}();l&&(a=l)}o?d.pkceManager.runPKCE(a,function(){p.getSSOKey(a,g(e),t)}):p.getSSOKey(a,g(e),t)}}else{u.error("Not authenticator",c);h.runCallback(t)}};this.reAuthenticate=function(e,t){u.info("reAuthenticate",c);if(p){var i=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector);i&&i.configuration&&i.configuration.pkceEnabled?d.pkceManager.runPKCE(i,function(){p.getSSOKey(i,g(e),t)}):p.getSSOKey(i,g(e),t)}};this.isErroneous=function(){if(p)return p.isErroneous();u.error("Not authenticator",c)};this.dispose=function(){u.info("dispose",c)}};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow.StepUpManager=window.lpTag.unifiedWindow.StepUpManager||function(e){var a,r,l,t,i,n,o,d,c=lpTag.unifiedWindow.log,s=lpTag.taglets.authenticator,u=lpTag.unifiedWindow.events.chat,p=window.lpTag.taglets.lpSecureStorage,h="StepUpManager",f={},g=!1,m={success:null,fallback:null,error:function(){c.error("failed to stepup, auth error",h);setTimeout(F,0)}},v="onBehalf",w="sub",_="exp",C={outOfAuthArea:-1,noStepUp:0,stepUp:1,alreadySteppedUp:2,stepUpEnded:3,failedStepUp:4},T={},R={idpVersion:"3.0"},E={csds:{idp:"idp",leCdnDomain:"leCdnDomain"},storage:{unauthStorage:{key:"-unAuthJWT",name:"unAuthMessaging"},stepUpStorage:{appName:"StepUP",valueKeys:{lastActiveConvo:"lastActiveConvo",jwt:"-stepUpJWT",lastStepUpState:"lastStepUpState"}}}},y={};function k(e){var t=null;"OPEN"===e.state&&e.convId&&(t=e.convId);p.setValue({app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,key:E.storage.stepUpStorage.valueKeys.lastActiveConvo,appName:E.storage.stepUpStorage.appName,site:y.accountId,value:t,domain:y.secureStorageLocation,success:function(e){c.debug("stored last unauth convo data",h)},error:function(e){c.debug("failed to store last unauth convo data",h)},firstParty:!0});if("CLOSE"===e.state){l=C.stepUpEnded;n.modify(lpTag.unifiedWindow.uiModelPath.STEP_UP_STATE,l)}}function b(e,i){var t=y.authenticationLocation,n=g?lpTag.taglets.fetch:lpTag.taglets.postmessage,e={lp_jwt:e};i.redirect_uri&&(e.redirect_uri=i.redirect_uri);f.authConnector.type===lpTag.unifiedWindow.consts.authConnectorTypes.OAUTH_IMPLICIT?e.id_token=i.ssoKey:e.code=i.ssoKey;i.code_verifier&&(e.code_verifier=i.code_verifier);t={url:t,method:"POST",success:function(e){var e=e.body.token,t=M(e,[v,w]);T.unAuthConsuemrId=t[v];T.authConsumerId=t[w];o=e;t=a&&a.conf;t&&t.authConf&&(t.authConf.stepUpConnector=f.authConnector);t&&t.engConf&&(t.engConf.stepUpConnector=f.authConnector);i.ssoKey&&i.redirect_uri&&window.lpTag.taglets.lpSecureStorage.setValue({app:"monitoringSDK",appName:"lp_monitoringSDK",site:lpTag&&lpTag.site,domain:y.secureStorageLocation,success:function(){},error:function(e){c.error("Error when setting data for SMT - "+e,h)},firstParty:!0,key:"lpsmtAuth",value:{tkn:e,code:i.ssoKey}});m.success(o)},error:function(e){c.error("failed to get onbehalf jwt from IDP",h);m.fallback()},data:e};if(g){t.headers=t.headers||{};t.headers["Content-Type"]="application/json"}else lpTag.taglets.postmessage.isValidRequest(t)||O();n.issueCall(t)}function S(n){return function(e){var i={},t=f.authConnector&&f.authConnector&&f.authConnector.configuration.pkceEnabled;if("object"==typeof e){i.ssoKey=e.ssoKey;i.redirect_uri=e.redirect_uri}else i.ssoKey=e;t?a.pkceManager.getPKCEFromSecureStorage(function(e){e&&e.code_verifier&&(i.code_verifier=e.code_verifier);a.pkceManager.removePKCEFromSecureStorage();b(n,i)},function(e){c.error("Error when getting PKCE data from storage - "+e,h);b(n,i)}):i.redirect_uri?window.lpTag.taglets.lpSecureStorage.getValue({app:"monitoringSDK",appName:"lp_monitoringSDK",key:"lpsmtAuth",site:lpTag&&lpTag.site,domain:y.secureStorageLocation,success:function(e){var t;e&&e.tkn?(t=M(e.tkn,[_]))&&t.exp&&Date.now()<1e3*t.exp&&m.success(e.tkn):b(n,i)},error:function(e){c.error("Error when getting lpsmtAuth from storage - "+e,h);b(n,i)},firstParty:!0}):b(n,i)}}function V(e){var t=e.body.token,e=f.authConnector&&f.authConnector.configuration.pkceEnabled;a&&a.pkceManager&&e?a.pkceManager.runPKCE(f.authConnector,function(){s.getSSOKey(f.authConnector,S(t),I)}):s.getSSOKey(f.authConnector,S(t),I)}function I(e){c.error("Step up failed to auth with auth connector",h);m.fallback()}function N(e){var t=g?lpTag.taglets.fetch:lpTag.taglets.postmessage,e={url:y.unauthJwtLocation,method:"POST",data:{id_token:e},error:function(e){m.fallback()},success:V};if(g){e.headers=e.headers||{};e.headers["Content-Type"]="application/json"}else lpTag.taglets.postmessage.isValidRequest(e)||O();t.issueCall(e)}function x(){y.authenticationLocation=L(y.idpDomain,{accountId:y.accountId,connectorId:f.authConnector.id});y.unauthJwtLocation=L(y.idpDomain,{accountId:y.accountId,connectorId:f.unauthConnector.id});e=E.storage.unauthStorage.key,t=E.storage.unauthStorage.name,window.lpTag.taglets.lpSecureStorage.getValue({key:e,site:y.accountId,app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,success:function(e){var t,i,n,a=lpTag.taglets.lpSecureStorage;"function"==typeof a.isFirstPartyStorageFeatureEnabled&&(t=a.isFirstPartyStorageFeatureEnabled());e&&t?(i=e,a=E.storage.unauthStorage.key,n=E.storage.unauthStorage.name,window.lpTag.taglets.lpSecureStorage.getValue({key:a,site:y.accountId,app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,success:function(e){N(P(i)k){var l=R.clone(w.TAB_LIST);l.path=l.path+"."+o[r];c.removeKey(l);o[r]==a&&c.modify(w.LAST_VIEWED_TAB,"")}i()})}function B(){return b.getStorageType(n).lpUnifiedWindow!==b.storageTypes.SESSIONSTORAGE}function P(){var e=function(){var e=0,t=a.get(_.LINES)||[],i=c.get(w.LAST_LINE_VIEWED);if(i)for(var n=t.length-1;0<=n;n--){if(t[n]["@id"]===i["@id"]&&t[n].convId===i.convId)return e;isNaN(t[n]["@id"])||"agent"!==t[n].source||t[n].history||e++}return 0}.call(this),t=void 0===C||C!==e,i=v&&v.isHidden();if(t)if(i&&0i["@id"]&&t.convId===i.convId&&"agent"===t.source&&!t.update)||function(e,t){if(e.convId!==t.convId&&"agent"===e.source&&!e.update)return 0===e["@id"]&&c.modify(w.LAST_LINE_VIEWED,{"@id":e["@id"],localId:e.localId,convId:e.convId}),1}(n[s],a))&&o){if(1>>f;if(0>>f)*s;d[E+1]=(P*h>>>f)*s;d[E+2]=(O*h>>>f)*s}else d[E]=d[E+1]=d[E+2]=0;if(0===M){_[W]=((n=W+p)]+)>((?:.(?!\\<\\/a\\>))*.)","gim")},href:{regexp:new RegExp("href=\"(.*?)\"|href='(.*?)'","gim")},link:{regexp:new RegExp("(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#/%=~_|$])","gim")}},o=[],s=[];function l(e){var t=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"];return t.slice(0,e).map(function(e){return t[Math.random()*t.length|0]}).join("")}function d(e){var t;try{t=lpTag.HtmlSanitizerUtils.sanitizeAndCleanHtml(e)}catch(e){lpTag.unifiedWindow.log.error("_htmlSanitization",e);t=""}return t}function c(e){var t=document.createElement("textarea"),i=(t.innerHTML=e,t.value),t=(t.remove(),i.replace(/[^a-zA-Z0-9.\/:-]/gim,"")),i=-1===e.indexOf("://")&&-1===e.indexOf("www.");return e=-1"===i[o+2]&&(i=i.slice(0,o)+i.slice(o+3));n.innerHTML+=t;e=c(e).trim();n.innerHTML+=""+e+""});i=d(i=i.slice(o));n.innerHTML+=i;if(n.children)for(var t=0;t"+a+"")}var o;return e},textContainsMarkDownSyntax:function(e){return e.match(r.markdownToHtml.regexp)},sanitizeTextFromHTML:d,textContainsAHREFSyntax:function(e){return e.match(r.anchorTagRegex.regexp)}}};window.lpTag=window.lpTag||{};window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{};!function(){var l;lpTag.unifiedWindow.BaseViewController=window.liveperson.uiframework.latest.ViewController.extend({ControllerName:"BaseViewController",logger:lpTag.unifiedWindow.log,util:lpTag.taglets.lpUtil,uiPath:lpTag.unifiedWindow.uiModelPath,chatPath:lpTag.unifiedWindow.chatModelPath,EventName:lpTag.unifiedWindow.events,appConsts:lpTag.unifiedWindow.consts,VCEvents:lpTag.unifiedWindow.events.viewController,State:lpTag.unifiedWindow.State,prefixPlaceHolder:"{{PREFIX}}",customAnimationDurations:{},animationClasses:{bounce:"lpBounceClass",shakeX:"lpShakeXClass",shakeY:"lpShakeYClass"},LPReadNotificationsTypes:{none:{value:"none"},visual:{value:"visual",templates:{PENDING:"{{iconTitle}}",SENT:"{{iconTitle}}",ACCEPT:"{{iconTitle}}",READ:"{{iconTitle}}",ERROR:"{{iconTitle}}",image_ERROR:"{{iconTitle}}",image_RETRY:"{{iconTitle}}"}},text:{value:"text"}},initialize:function(e){this.uiPath=lpTag.unifiedWindow.uiModelPath;this.chatPath=lpTag.unifiedWindow.chatModelPath;this.appContext=e.appContext;this.timeStampManager=e.appContext.timeStampManager;this.timeStampGroupingEnabled=this.timeStampManager.timeStampGroupingEnabled();l.enableStrictCspMode=!!(this.appContext&&this.appContext.conf&&this.appContext.conf.unifiedConf&&this.appContext.conf.unifiedConf.enableStrictCspMode);if(!l.animationCreated&&!l.enableStrictCspMode&&this.appContext.deviceDetector.isAnimationSupported()){l.animationPrefix=this.appContext.deviceDetector.getAnimationData().preFix;l.animationsSupported=!0;l.cssAnimation=document.createElement("style");l.cssAnimation.type="text/css";document.getElementsByTagName("head")[0].appendChild(l.cssAnimation);this.createDefaultAnimations()}},render:function(){l.enableStrictCspMode&&this.customize(this.view)}});(l=lpTag.unifiedWindow.BaseViewController.prototype).templateString=function(e,t){e=window.liveperson.uiframework.latest.ViewController.prototype.templateString.call(this,e,t);return e=l.enableStrictCspMode?function(e){"string"==typeof e&&(e=(e=e.replace(/(<[^>]+) style=".*?"/gi,"$1")).replace(/<[^>]+ style=".*?" \/>/gi,function(e){return e.replace(/ style=".*?"/gi,"")}));return e}(e):this.customize(e)};l.createDefaultAnimations=function(){if(!l.animationCreated){this.createKeyframe(this.animationClasses.bounce,[{percent:0,animate:this.prefixPlaceHolder+"transform: scale(1, 1);"},{percent:40,animate:this.prefixPlaceHolder+"transform: scale(1.15, 1.1);"},{percent:100,animate:this.prefixPlaceHolder+"transform: scale(1, 1);"}],500);this.createKeyframe(this.animationClasses.shakeX,[{percent:0,animate:this.prefixPlaceHolder+"transform: translateX(0px);"},{percent:20,animate:this.prefixPlaceHolder+"transform: translateX(-15px);"},{percent:40,animate:this.prefixPlaceHolder+"transform: translateX(15px); "},{percent:60,animate:this.prefixPlaceHolder+"transform: translateX(-10px);"},{percent:80,animate:this.prefixPlaceHolder+"transform: translateX(10px);"},{percent:100,animate:this.prefixPlaceHolder+"transform: translateX(0px);"}],400);this.createKeyframe(this.animationClasses.shakeY,[{percent:0,animate:this.prefixPlaceHolder+"transform: translateY(0px);"},{percent:20,animate:this.prefixPlaceHolder+"transform: translateY(-15px);"},{percent:40,animate:this.prefixPlaceHolder+"transform: translateY(15px); "},{percent:60,animate:this.prefixPlaceHolder+"transform: translateY(-10px);"},{percent:80,animate:this.prefixPlaceHolder+"transform: translateY(10px);"},{percent:100,animate:this.prefixPlaceHolder+"transform: translateY(0px);"}],400);l.animationCreated=!0}};l.createKeyframe=function(e,t,i){if(l.cssAnimation){for(var n="."+e+" {"+l.animationPrefix+"animation: lpanim_"+e+" "+i/1e3+"s 0s 1 ease-in-out;}@"+l.animationPrefix+"keyframes lpanim_"+e+" {",a=0;at[i]?1:0}):t},cloneObj:function(e){return JSON.parse(JSON.stringify(e))},isEmptyLiteral:function(e){for(var t in e)return!1;return!0},isSameObject:f,addClassByArray:function e(t,i){if(h(i))for(var n=0;n":">",'"':""","'":"'","/":"/","`":"`","=":"="};if(e)return e.replace(/[&<>"'`=/]/g,function(e){return t[e]})},createDateFromString:function(e){var t=new Date(e);if(isNaN(t)){t=new Date,e=e.match(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)([.])(\d+)([+-])(\d+):(\d+)/);if(e&&12==e.length){t.setUTCFullYear(parseInt(e[1],10));t.setUTCMonth(parseInt(e[2],10)-1);t.setUTCDate(parseInt(e[3],10));t.setUTCHours(parseInt(e[4],10)-parseInt(e[9]+"1",10)*parseInt(e[10],10));t.setUTCMinutes(parseInt(e[5],10)-parseInt(e[9]+"1",10)*parseInt(e[11],10));t.setUTCSeconds(parseInt(e[6],10))}0}return t},formatDay:function(e,t,i,n,a,o){var s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"];if(t)for(var l=0,d=s.length;l"):t},escapeHtml:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return e.replace(/[&<>"'`=/]/g,function(e){return t[e]})},htmlToElement:function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},hasClass:function(e,t){return e.classList&&e.classList.contains?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){e.classList?e.classList.add(t):this.hasClass(e,t)||(e.className+=" "+t)},removeClass:function(e,t){if(e.classList)e.classList.remove(t);else if(this.hasClass(e,t)){t=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(t," ")}},generateRandomId:function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},appendAttributesFromObject:function(t,i){Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])})}}},function(e,i,t){var n,a;!function(e){"use strict";n=function(){return function(n,e,t){"use strict";function i(e,t,i){var n=[];if(e[t]&&e[t].length)for(var a=0;a0?(e.index>=e.eventBufferLimit&&(e.index=0),e.fired[e.index]=t,e.index++):e.fired.push(t),e=null}}function l(e,t){var i=!1;if(!t)return u("Ev listen id not spec for unregister","ERROR","Events"),null;for(var n in e)if(e.hasOwnProperty(n))for(var a=0;a0)for(var o=0;o0}function d(t,e,i){return function(){try{t.func.call(t.context,e,i),e=null,t.triggerOnce&&n(t),t=null}catch(e){w.log("Error executing "+i.eventName+" eventId: "+t.id+"e="+e.message,"ERROR","Events")}}}function u(e){w.storeEventData({triggerData:e,eventBufferLimit:o,attrName:r,fired:l,index:v})}var p,o,h,s="Events",r="eventName",f=0,g={},l=[],m="evId_",v=0;h=e&&e.appName||"*",p=!(!e||"boolean"!=typeof e.cloneEventData)&&e.cloneEventData,o=e&&!isNaN(e.eventBufferLimit)?e.eventBufferLimit:-1,this.once=t,this.hasFired=i,this.trigger=a,this.publish=a,this.bind=c,this.register=c,this.unbind=n,this.unregister=n}return t||(e.Events=e.Events||i),i}(t,e,!0)}.apply(i,[n]))&&(e.exports=a)}("undefined"==typeof ChronosRoot?this:ChronosRoot)},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t,i){return t&&u(e.prototype,t),i&&u(e,i),e},s=n(i(4)),r=n(i(0)),l=i(1),d=function(e){function i(e,t){a(this,i);e=function(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e));return e.errors=t,e}var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);return i}(Error),i=(o(c,[{key:"init",value:function(e){e&&(Object.prototype.hasOwnProperty.call(e,"maxAllowedElements")&&(!isNaN(e.maxAllowedElements)&&0=this.maxAllowedElements)){var a=n,n=this.provider.get(e.type),o=void 0;n&&(o=n(e),o=this.onAfterElementRendered?this.onAfterElementRendered(o,e):o)&&(t.appendChild(o),Array.isArray(e.elements)&&e.elements.forEach(function(e){a+=1,i.renderElement(e,o,a)}),o.afterRender)&&o.afterRender.call(o,e,t)}}},{key:"render",value:function(e){var e=r.default.isString(e)?JSON.parse(e):e,t=(this.validate(e),document.createDocumentFragment()),i=document.createElement("div");return i.className="lp-json-pollock",r.default.isLayout(e.type)||(i.className+=" lp-json-pollock-single-element"),t.appendChild(i),this.renderElement(e,i),t}},{key:"validate",value:function(e){if(!r.default.isObject(e))throw new d("JsonPollock::validte - input is not an object");if(this.schemaValidator){e=this.schemaValidator.validate(e);if(!e.valid)throw new d("Schema validation error, see 'errors' for more details",e.errors)}}},{key:"registerAction",value:function(e,t){this.events.bind({eventName:e,func:function(e){t(e)}})}},{key:"unregisterAction",value:function(e){this.events.unbind({eventName:e})}},{key:"unregisterAllActions",value:function(){this.events.unbind({})}},{key:"registerElement",value:function(e,t){this.provider.set(e,t)}}]),c);function c(e){a(this,c),this.events=new l({cloneEventData:!0,appName:"json-pollock"}),this.provider=new s.default(this.events),this.maxAllowedElements=50,this.schemaValidator=e}function u(e,t){for(var i=0;i"+e.caption+""),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(i,e.accessibility.web),i.onload=function(){w.default.removeClass(t,"loading")},i.onerror=function(){w.default.removeClass(t,"loading"),w.default.addClass(t,"error"),t.title="fail to load image",i.style.display="none"},e.click&&e.click.actions&&(i.onclick=v.wrapAction(e.click)),t.appendChild(i),t}),this.set(o.MAP,function(t){var e=t.accessibility&&t.accessibility.web,i=document.createElement("div");return i.className="lp-json-pollock-element-map",t.tooltip&&(i.title=t.tooltip,i.setAttribute("aria-label",t.tooltip)),t.style&&(i.style.cssText=w.default.styleToCss(t.style)),e&&w.default.appendAttributesFromObject(i,t.accessibility.web),e&&e.tabindex||i.setAttribute("tabindex","0"),i.onkeydown=function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),window.open("https://www.google.com/maps/search/?api=1&query="+t.la+","+t.lo,"_blank"))},t.click&&t.click.actions?i.onclick=v.wrapAction(t.click):i.onclick=function(){window.open("https://www.google.com/maps/search/?api=1&query="+t.la+","+t.lo,"_blank")},i}),this.set(o.VERTICAL,function(e){var t=document.createElement("div");if(t.className="lp-json-pollock-layout lp-json-pollock-layout-vertical","borderLess"===e.border?w.default.addClass(t,"lp-json-pollock-layout-borderLess"):"dropShadow"===e.border&&w.default.addClass(t,"lp-json-pollock-layout-dropShadow"),"enable"===e.scroll)if(w.default.addClass(t,"lp-json-pollock-layout-vertical-scroll"),e.style&&e.style.size){var i=e.style.size,n=100;"medium"===i?n=300:"large"===i&&(n=500),t.setAttribute("style","height: "+n+"px")}else t.setAttribute("style","height: 100px");return e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(t,e.accessibility.web),e.metadata&&t.setAttribute("data-metadata",JSON.stringify(e.metadata)),t}),this.set(o.TABS,function(i){var e=i.elements,l=document.createElement("div"),n=document.createElement("div"),d=(l.appendChild(n),""),c="",a="",u="";if(i.style){var t=i.style.color,o=i.style["background-color"],s=i.style["color-active"],r=i.style["background-color-active"],p=i.style["color-hover"],h=i.style["background-color-hover"],f=1;i.style.size&&("small"===i.style.size?f=1:"medium"===i.style.size?f=2:"large"===i.style.size&&(f=3)),d=(d+=t?"color: "+t+"; ":"")+(t?"border-bottom: "+f+"px solid "+t+"; ":"")+(o?"background-color: "+o+"; ":""),c=(c+=s?"color: "+s+"; ":"")+(s?"border-bottom: "+f+"px solid "+s+"; ":"")+(r?"background-color: "+r+"; ":""),a=(a+=p?"color: "+p+"; ":"")+(p?"border-bottom: "+f+"px solid "+p+"; ":"")+(h?"background-color: "+h+"; ":"")}function g(e){for(var t=l.children,i=t[0].children,n=[],a=1;au.offsetWidth&&(r.style.visibility="hidden",l.style.visibility="hidden"),h=u.children,"rtl"===window.getComputedStyle(l).direction&&(r.style.visibility="visible",l.style.visibility="visible",p=h.length-1,h=[].slice.call(h,0).reverse(),s=-1*(h[p].offsetLeft-(d.offsetWidth-h[p].offsetWidth))+"px",u.style.left=s)},0),l.onclick=function(e){!function(e){p===h.length-1?p=0:p+=1,n(),i.call(this,e)}.call(v,e)},r.onclick=function(e){!function(e){0===p?p=h.length-1:--p,n(),i.call(this,e)}.call(v,e)}}},d}),this.set(o.CAROUSELSELECT,function(n){function i(e,t){t?(e.setAttribute("data-selected","true"),e.classList.add("lp-json-pollock-layout-selected"),n.style&&n.style["border-color-selected"]&&(e.style.borderColor=n.style["border-color-selected"])):(e.removeAttribute("data-selected"),e.classList.remove("lp-json-pollock-layout-selected"),e.style.borderColor="")}function a(e){var t=function e(t){if(t&&"BUTTON"!==t.tagName)return null!==t.getAttribute("data-carousel-index")?t:e(t.parentNode)}(e.target);t&&("single"===n.selectMode.type&&t.parentNode&&Array.from(t.parentNode.querySelectorAll("[data-carousel-index][data-selected]")).filter(function(e){return e!==t}).forEach(function(e){i(e,!1)}),i(t,"true"!==t.dataset.selected))}var o=n.padding||0,s=document.createElement("div"),r=document.createElement("div");if(n.accessibility&&n.accessibility.web&&w.default.appendAttributesFromObject(s,n.accessibility.web),n.style){var e=w.default.styleToCss(n.style),e=w.default.extractFromStyles(e,"background-color");r.style.cssText=e.style,r.setAttribute("style",e.extractedStyle)}return s.afterRender=function(){var e=s.children.length;if(e){for(var t=0;t